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

learn more… | top users | synonyms (5)

3
votes
3answers
2k views

How to correctly get post type in a the_title filter

I want to prepend text to the post titles of a specific custom post type, but the filter below didn't work. Instead of changing only that CPT's post titles, it changed all titles on the given CPT's ...
6
votes
3answers
719 views

How to filter by post-format in admin?

I need to filter my posts by Post-Formats in admin ? How can I do that ? For now, Wordpress allows to filter by Categories and Dates.
1
vote
2answers
2k views

Default or Preset Content for Custom Post Types

I am trying to modify the code for default content to display based on post type, but so far I have been unsuccesful. The base code is: add_filter( 'default_content', 'my_editor_content' ); ...
0
votes
2answers
782 views

Editing wp-config.php

I need to add the line define('WP_POST_REVISIONS', false); to my config.php , so that post revisions are disabled. I don't have access to wp-config.php, I have permission to edit my theme and ...
1
vote
1answer
191 views

Change comments form title on a page by page basis

I'm looking to change the comments form title (my theme defaults this to "Leave a Comment" or "Leave a reply to"). I thought perhaps I could add a hook to comment_form_defaults but my snippet below ...
0
votes
1answer
2k views

Getting post id from wp_insert_post_data function?

I'm trying to use the function get_the_tags() from outside the 'loop'. I understand this can be achieved by using the post ID like get_the_tags($postID). Does anyone know how I can get the post ID ...
1
vote
1answer
967 views

How to filter WordPress search, excluding post in some custom taxonomies?

I want to filter WordPress search (and also WordPress listing of posts) on 2 values of a custom taxonomy. I tried this code, filtering my custom taxonomy named "marque", excluding 70 or 67 IDs (nb : ...
1
vote
1answer
620 views

Filtering post-formats from the loop using new WP-Query();

Hi i am currently building upon a theme that i have build previously for my blog. The following code is to point to the latest post (the featured post). As this will have a different styling than all ...
0
votes
1answer
419 views

Using add_action before add_filter on a plugin?

I'm writing a plugin and having a problem. I have add_action('publish_post', 'sender'); and I want this function to run first before the add_filter function, although it won't. Is there a way to do ...
0
votes
1answer
156 views

Is it possible to add an argument to a custom function added to a filter hook?

Example: I'm trying to modify an instantiation of WP_Query by using the posts_orderby filter like so: add_filter('posts_orderby', 'favorites_orderby'); $new_query = new WP_Query($args); ...
0
votes
1answer
57 views

Is there a way to figure out which action/filter invoked a function?

I'd like a lightweight way to figure out what is invoking a certain action in an effort to provide logic for certain scenarios where I can't help to avoid a function invocation (for example, a new ...
3
votes
2answers
776 views

Custom theme hooks / filters - passing arguments

I'm getting confused trying to implement these custom theme hooks. Trying to wrap my head around that. I thought i understood this. but now after reading code for several hours; it's made it worst. ...
0
votes
2answers
887 views

Sort posts after filtering them through multiple taxonomies

I'm using scribu's Query Multiple Taxonomies to filter posts through multiple taxonomies (which works great!). However, I'd like to allow people to perform further sorting on the results based on ...
0
votes
1answer
203 views

Prepending character(s) to a custom <!--more--> tag title?

I'm hacking around with a blog using Cordobo Green Park and I've noticed when I specify a custom title, instead of it beginning with a » symbol (as it does for the standard "» Read more: ...
1
vote
1answer
450 views

How do I access the menus produced by Dashboard > Appearance > Menus

A continuation to this question: Replacing WordPress menu functionality with a plugin Since I really rarely work with WordPress (I've done a lot of work with phpBB, myBB, Concrete5, and custom PHP ...
1
vote
3answers
3k views

Using filter to add additional fields to comment_form()

I want to add a field to the comments and have used these codes. functions.php function my_fields($fields) { $fields['url2'] = '<p class="comment-form-url2"> ...
1
vote
1answer
1k views

Categories of custom taxonomy don't show any posts

I want to display posts from categories of my custom taxonomy but realy don't know how to achieve this. I am using isotope filtering which works as expected with default post categories. I can click ...
3
votes
1answer
2k views

What is the very earliest action hook you can call?

After the solution to this question was to get a function to launch BEFORE the init action is fired by taking the sequence out of its function, it got me thinking, is there any earlier in the WP load ...
0
votes
3answers
1k views

Make parent categories not selectable

I'd like that my categories having child-categories don't be selectable on the post article page. What I want to do is to remove the checkbox before their label. I've looked the filter documentation ...
1
vote
1answer
339 views

In need of a content replace filter for posts in a specific wordpress category

I have been doing some research on this but can't get a handle on the exact code I need to do this. I am using a wordpress content slider that strips out <ul></ul> and ...
5
votes
2answers
2k views

Earliest hook to reliably get $post/$posts

What's the earliest possible action I can hook into where I'll be able to access the global $post/$posts variables on both the front and back ends? I've tried looking through the Codex reference, Adam ...
0
votes
1answer
403 views

Why doesn't my simple the_title filter get applied?

I have added the code below to an active plugin, but it's having no effect on my posts. add_filter( ‘the_title’, ‘myfunction’); function myfunction($title) { return "Why won't this work?" . ...
1
vote
1answer
504 views

How to modify an existing meta description?

I'm coding a plugin that allows me to dynamically insert content for my meta description and title. The content is already being pulled fine, the only part I can't get to work is actually filtering ...
1
vote
1answer
810 views

How to limit search to first letter of title?

I was wondering if there was a way to make the search only look for the first letter in the posts title, basically let's say my search query is www.mysite.com/?s=q I'd like to get all posts that start ...
0
votes
1answer
1k views

Filter or Hook to catch pre-rendering of post content

Is there a filter or hook that is triggered just before post content is rendered? What I'd like to do is to apply a filter to the text content of a post just before the post text is being rendered.
1
vote
1answer
436 views

What is the proper way to apply the login_form_bottom filter?

Here is my current code. function custom_login_footer() { return '<p>text text text</p>'; } add_filter('login_form_bottom', 'custom_login_footer'); I am trying to add text below the ...
0
votes
2answers
375 views

Filter “Your latest posts”

On the Reading Settings page I have clicked Your latest posts under Front page displays. I am wondering how I can filter the query that displays these posts before it gets to the loop. I have tried ...
0
votes
2answers
3k views

Filter have_posts()/ the_post()

What is the best way to filter the posts being displayed? For example in my functions.php file I want to have something like add_filter( $tag, 'filter_posts'); function filter_posts(){ ...
0
votes
1answer
337 views

How to remove the RichText Meta Box

How can I remove the rich text box editor in WordPress? I have used the remove_meta_box function specifying the boxes ID, but it does not work like it does for other core meta boxes: The code I ...
0
votes
1answer
154 views

return get_the_tag_list with whitespace removed

I need to get_the_tag_list but want to remove whitespace within individual tags. Thus, firefox, internet explorer, opera becomes firefox, internetexplorer, opera All the filters I found ...
0
votes
3answers
1k views

Ajax, filters and shortcodes

could you figure out why I'm unable to get shortcode filters applied in ajax inclusion of posts? Let me explain better: I've managed to include a post from within another post, through ...
0
votes
2answers
144 views

Alter required message using comment form api

I prefer not to use asterisk markers on required fields in the comment form. So I'd like to remove or alter the 'required fields are marked (*)' message. Being a good wordpress user, I'd like to do ...
1
vote
1answer
370 views

Taxonomy filter all children

I have a custom taxonomy filter that will filter all the pages in the selected taxonomy. I would like the code to select the pages in that taxonomy, and the children of thous pages. Heres the code. ...
4
votes
3answers
734 views

Is calling function_exists() faster or slower that apply_filters()

Is calling function_exists() faster or slower that apply_filters() ... or is the difference so small that it should not be considered? I did a bit of testing based on Kaiser's and it showed that ...
0
votes
1answer
467 views

Trying to exclude custom posts based on date, while sorting by custom field

I have a custom post type named "performance". I have a custom post query that orders posts by a custom field value (order-date). Now I want to exclude posts that have order-dates that are in the ...
7
votes
4answers
2k views

LESS CSS enqueue_style with add_filter to change rel attribute

What I'm trying to do is use less css with Wordpress. You're supposed to link to your .less files with the rel attribute set to 'stylesheet/less'. But I can't figure out how to alter the code that ...
1
vote
2answers
2k views

plugin_action_links Filter Hook Deprecated?

http://adambrown.info/p/wp_hooks/hook/plugin_action_links_%7B$plugin_file%7D Says the hook is deprecated. However, the {$prefix}plugin_action_hook_{$plugin_file} is not. I poked around the ...
1
vote
1answer
563 views

How can I filter by slug depending on language selection

I'm new to this site but looking at the quality of answers provided here I will be here for a long time :) Ok, first a bit of info: I'm developing a bilingual website (English & Japanese) using ...
2
votes
3answers
871 views

Allow unfiltered HTML in titles for low level users?

How can the unfiltered_html capability be given to non network admins in a multisite install to allow HTML in titles? In wp-includes/capabilities.php (below) it appears that this capability can not ...
1
vote
2answers
85 views

Is there a Filter that I can use to filter the tags before they are inserted in to the database?

I want to filter the tags before they are inserted into the database. I'm aware of the pre_insert_term filter. But what I need to do is to see all the tags at once. I need to limit the number of tags ...
4
votes
2answers
5k views

Default Image Link Removal

Just wondering if there is a way to remove WordPress's default function of adding a tag around an inserted image. I assume its a "remove_filter" function like you can do for WPAutoP, but all my ...
0
votes
1answer
125 views

How to create a list of terms who's posts also have a predefined external term?

I have a pretty extensive music collection and my friends are always borrowing my stuff. I would like to keep better track of my library so I'm building a sudo-checkout system using WP. The ...
0
votes
1answer
221 views

Filtering posts on Post Administration Page by Week Number instead of by Month

Has anyone written or can suggest a plugin that would replace the filter-by-month in the Post Administration screen with filter-by-week-number instead? e.g. a drop down option for "Week of ...
0
votes
3answers
2k views

What's the proper way to use the get_image_tag filter?

I'm attempting to remove the title attribute for post thumbnails (on certain posts), and I assume the get_image_tag filter is the way to do this. However, what I've got so far isn't working. What do I ...
2
votes
1answer
979 views

How to filter a dd/mm/yyyy date from a custom field in a query

I'm trying to build a query in order to sort some posts by a date custom field, where the dates are formatted dd/mm/yyyy. It works by querying the database directly with get_results like in this ...
0
votes
1answer
170 views

Filter Text from sidebar widget?

Hey guys, I'm using a calendar plugin that provides a sidebar widget to show current calendar dates. However this widget always shows N/A if I don't set a category for a specific event. Any idea how ...
0
votes
1answer
355 views

Fix warning: Missing argument

i want to submit a theme to the wordpress.org. when i put the define('WP_DEBUG', true); in my wp-config.php. my theme showed some errors.but i don't know how to correct theme. Q1:Warning: Missing ...
0
votes
1answer
1k views

Remove filter and view options from custom post type edit screen

I have my CPT edit screen almost looking how I want it but want to remove the filter and view options from this screen as they are not needed for this interface. How do I remove them? Are there any ...
0
votes
2answers
570 views

Add filter to the end of the post

I have a function which is used to display a video, I want this video to be shown after the post, It should display the video when the post ends. I have added filter to it, but then too, the video is ...
2
votes
1answer
343 views

Wordpress Genesis Child Theme Filter divs

I'm trying to html5ize a Genesis child theme. So far I've figured out how to replace the Doctype via hook but am having trouble figuring out how i can change the divs to sections and articles without ...