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

learn more… | top users | synonyms (5)

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
510 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
644 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
375 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
793 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
375 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
299 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
617 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
806 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
834 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
408 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(){ ...
16
votes
2answers
7k 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 ...