Tagged Questions

A type of hook that provides a way for content to be overridden programatically

learn more… | top users | synonyms (5)

1
vote
2answers
595 views

How to detect filter in URL in Category page?

I need to add an additional filter based on a category for posts that have a custom post_type. For example, I have a page located at /category/tasks that lists all tasks. I need to make it so I can ...
1
vote
2answers
4k views

Custom Post Row Actions

I came across this question while writing this question. I have one question that extends upon that question. I figured out that you use the get_delete_post_link filter to create a new url for my ...
1
vote
1answer
113 views

Filter custom posts with / without comments

I need to display (for pages that use a particular page template) a list of custom post type objects filtered into 2 sets - those with comments, and those without comments. Each of these sets should ...
-1
votes
4answers
13k views

Is there any multiple filter/criteria plugin for wordpress? [closed]

I'm interested in a wordpress plug-in that is able to make from tags or categories multiple search criteria like left hand side of the following site system http://www.olx.com/dvd-cat-238 When one of ...
1
vote
1answer
848 views

add_filter multiple times with different addon functions?

I'm adding this filter when the condition is true. Can I add another function on the same filter when the 2nd condition is true or will the last one cancel out the previous one? ...
3
votes
3answers
3k views

I'm using a filter to remove the <p> tags auto wrap, but there still wrapped elements?

I have this in my functions.php: The images inside the slider were added as custom post types called "Page Content." I'm not sure if the filter only applies to the main Posts. /** * Remove ...
1
vote
1answer
1k views

Title_save_pre - Simple problem that u know for sure

I have two custom post type. Then I need to use title_save_pre to post title prior to saving it in the database. I need to use this filter just for one custom post type. This is my function: ...
0
votes
1answer
3k views

Overriding default calendar to show posts from a category

I'm trying to modify the default WP calendar (get_calendar()) so that it shows posts from a specific category and then use that as a shortcode. Here's what I've done: Copied across the ...
2
votes
1answer
1k views

Allowing non-latin characters in registration

I am from Turkey and we have "şŞçÇğĞüÜöÖıİ" characters in our alphabet. I want to use those characters in permalinks/slugs/usernames. I found temporary solution for permalinks/slugs with ...
1
vote
2answers
771 views

Help with issues on “Adding a Taxonomy Filter to Admin List for a Custom Post Type?”

This question relates to a solution found here from user somatic and mikeSchinkel I am testing somatic's solution, and it loads and populates the dropdown with no issues, but When you click filter, ...
0
votes
2answers
585 views

Change tags url to search different site

** UPDATED BELOW ** Original Question: Anyone know how to create a function that changes the url of the_tags so that when one is clicked on, the function searches another domain? ** UPDATE ** IT ...
1
vote
1answer
471 views

Event Calendar using insert_post_data after save_post and insert_post after post_transition draft_to_schedule

OK, I'm taking on the dreaded task of developing an event calendar for my site and have gotten a bit stuck. I'm open to any and all ideas but here's what I'm doing and what I'd like to do. I'm ...
2
votes
2answers
701 views

How to remove commenters ability to add hyperlinks to comments?

I'd like to be able to filter out a commenters ability to add hyperlinks in their comment text. I removed the "websites" field from the mix to reduce the amount of spammage already (see: Removing ...
2
votes
1answer
2k views

Explanation of the “posts_join” and “posts_fields” filter hooks?

I'm new to the "posts_" filter hooks and wanted to know a few things from those in the know: In this question, someone posted an answer using posts_join that took a second parameter of $query: ...
1
vote
2answers
486 views

When does wordpress process &lt;!--nextpage--&gt;

when does <!--nextpage--> get processed by wordpress filtering. i am adding multiple paged posts in post content on the content_save_pre and this is good for rendering my shortcodes, but ...
0
votes
1answer
3k views

Sorting/Filter posts from front-end in Wordpress blog

Here is the design I have mocked up http://enormo.us/clients/ischool/ The question is, how can I create a filtering system where the main blog area acts as the central feed and it combines the ...
0
votes
1answer
312 views

How to move featured image to the top of the list?

I have been working on using featured image to create a list of items on the right column here: http://www.julianamaeberger.com/soma/news/ The current featured image is now being given a class of ...
1
vote
3answers
9k views

Remove title attribute from images

I'm looking for a way to remove the title attribute from images, preferably through using a hook or a filter. Most clients don't bother giving images a proper title, thus eliminating the purpose of ...
3
votes
1answer
1k views

Is it possible to use a forgot password url filter?

i recently found that a login url filter is available but i can't find a solution for the forgot password as well, for the login url i use this: function custom_login_url($login_url) { return ...
4
votes
2answers
9k views

Filter WP_Query for posts having a certain meta-value

How to filter WP_Query for posts having a certain meta-value, without using a Custom Select Query? I have a custom posttype with meta-key: "open", and meta-value options: "yes" or "no". I would like ...
24
votes
4answers
15k views

Filter to remove image dimension attributes?

I'm working on a site based on a fluid width css template which sets a max-width on images to the width of the column containing them, and I need to remove the inline width and height dimension ...
1
vote
2answers
315 views

How to track post number on the_loop

I have a need to customize some posts from the loop. Here's the deal: My site is set to 10 posts per page. On post #2,#5, #7 (on every page), I want to display specific background. What's the best ...
1
vote
1answer
707 views

Custom wp_query time filter on meta_value

My goal is to only show posts with opening hours after business hours, for a given day. So, e.g. I have a (custom) post with following meta_key and meta_value: meta_key = 'monday, meta_value = '14:00 ...
0
votes
1answer
509 views

How to show a featured image as current?

On the right rail here: http://www.julianamaeberger.com/soma/sample-testimonial-3/ I am showing a random post "Testimonial". Below that I am showing all featured images for the category "Testimonial" ...
2
votes
2answers
632 views

add_filter return value

function validate_username( $username ) { $sanitized = sanitize_user( $username, true ); $valid = ( $sanitized == $username ); return apply_filters( 'validate_username', $valid, $username ...
0
votes
2answers
374 views

Check if variable is set in filter

Thanks to your suggestions, I enabled wp_debug and discovered flaws with my plugin. I have a filter for sorting posts by votes. I use it when the sort URL parameter is on. add_filter( 'posts_where', ...
2
votes
8answers
10k views

Filter get_categories() for taxonomy term in WordPress

I want to show a category only if a (custom) post is in that category AND region = $name for that post. So, e.g. I have a custom post (type "business") named "Mamma Mia" in child-category: ...
1
vote
1answer
1k views

add_query_arg not working

I added a filter to append a parameter onto the URL when navigating in categories. This is used to sort posts by their votes when browsing a category only if a sort parameter is set. For instance ...
0
votes
4answers
1k views

Why doesn't remove_action work in my plugin?

Using a WordPress multisite network with Buddypress. In order to modify the top nav bar, I've written a function to replace part of the menu. Calling it thus: add_action('bp_adminbar_menus', ...
1
vote
2answers
1k views

Conditional add_filter?

I need to apply an add_filter from my functions.php but only if the user has opened media-upload.php from my custom function. Is it possible to send a variable when opening media-upload.php that I ...
2
votes
1answer
791 views

Can I add custom meta for each image uploaded via media-upload.php?

I'm calling media-upload.php via a custom icon click inside the content editor and I would like to add a custom meta value for all images that are uploaded when the media-upload.php is called from my ...
3
votes
3answers
3k views

Best way to filter featured image text for a custom post type?

I am trying to change the "Set featured image", "Remove featured image", and "Use as featured image" text links of a custom post type for my plugin Meteor Slides. I found the ...
3
votes
2answers
2k views

Archive sorting functions by custom fields (front-end)

I want to give the users the ability to sort the posts in the archive by some custom fields that I pre-define. The end result would be en a tabbed container, and the user will click on the relevant ...
1
vote
2answers
814 views

How to apply content filter permanently?

I have the following temporary filter to fix a content error. We have data in our posts that have 4 digit zip codes, because the leading zero was cut when the original file was created. (For instance, ...
1
vote
2answers
374 views

Generating a Rewrite Rule for sSecific Post-Requests from a Submitted Form?

I have a form ( method post ) which makes it possible to filter my posts by specific criterias e.g. "Most Recent", "This week", "Last week", ... It works fine but of course the URL is the same for ...
1
vote
2answers
1k views

How to make <!--more--> a button?

There is plenty of information on how to make the Read More function display different text in the Codex but what kind of filter would need to be used to make it display <button class="readmorebtn" ...
0
votes
1answer
298 views

Edit post image attributes on fly?

Greetings, We can edit image attributes with this get_image_tag filter when we are adding images or with regex and filter the_content,but is there any similar filter or action that can we use to edit ...
3
votes
3answers
5k views

How to set custom cookies before output

What's a surefire way to check/set cookies before the php headers are sent? Is there an action or filter that would be the best place to hook a setcookie() function?
3
votes
2answers
2k views

At what priority does add_filter overwrite core functions?

I'm writing a plugin that adds some extra thumbnails, checkboxes, etc to the end of a post. I'm trying to figure out how to use add_filter properly. Basically, I've got add_filter('the_content', ...
0
votes
4answers
2k views

How to filter post from categories only if the posts appears in one of them, not the other?

The scenario is, some posts have one category, ok. Some others have more than one category. I must create post with content and also slideshow thumbnails for use with Nivo plugin gallery. Ok. I want ...
1
vote
1answer
615 views

How to order posts by one custom field and filter them by another one?

In my WordPress blog I have events I want to order and filter by custom fields. The order should be done by the custom field "event_date_end" which means that every event that is still running should ...
11
votes
1answer
5k views

Saving Taxonomy Terms

I have an interesting problem which I hope someone can quickly answer. I have created my own metabox which, based on "MY METABOX CODE" (list below) is correctly displaying a dropdown list of all my ...
0
votes
1answer
804 views

How to display a shortcode caption somewhere other than the_content

I want to disable shortcode captions for posts in one of my themes, and display the content elsewhere, such as in a sidebar. The images aren't uploaded to wordpress, but they're linked-to using the ...
3
votes
2answers
826 views

When does remove_filter not work?

There are reports that remove_filter does not work under some circumstances, and that we should provide alternatives. However, the article does not really make it clear under which circumstances this ...
2
votes
2answers
406 views

Is This A Correct Example Usage Of current_filter()?

Is this a good example of usage of current_filter()? <?php add_filter("_my_filter", "common_function"); add_filter("_another_filter", "common_function"); function common_function(){ ...
15
votes
2answers
6k views

Difference Between Filter and Action Hooks?

I have been looking at the plugin API a bit more in depth recently and I was wondering what real differences there were between action and filter hooks. They both are events that receive data as a ...
2
votes
4answers
2k views

How can I filter Microsoft Word gunk from pasted content?

I have some users who are posting to a group blog and are able to cut-and-paste but their pastes include things like: <!– /* Font Definitions */ @font-face {font-family:”Cambria Math”; panose-1:2 ...
1
vote
2answers
99 views

Can plugins that filter post contents work on posts from Word 2007?

I am testing blogging from Word 2007, so we can support users who wish to do so. Everything works fine, and as expected except the plugins that we use that add filters to the_content (eg ...
1
vote
2answers
88 views

Modifying the comments section through a plugin regardless of theme

I need to be able to add some data (text/images) to each comment in the comments section through a plugin. What I'm trying to do is actually very similar to the way the stack exchange sites have their ...