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

learn more… | top users | synonyms (5)

1
vote
2answers
239 views

How can I find out what an `apply_filter` call is actually doing?

As an example, I'm looking at class-wp-xmlrpc-server.php and there's a line (~115) that says: $this->methods = apply_filters('xmlrpc_methods', $this->methods); How can I actually find out ...
0
votes
1answer
45 views

Add a filter to a different custom plugin

Someone has built a custom plugin that adds a textarea on the admin/edit page, and a div on the pub page. I no longer have access to the person who built the custom plugin. I have created a filter ...
0
votes
1answer
311 views

Edit html for menu items in default frontend menu

I am running Multisite, and would like to be able to append menu items to all frontend menus on all sites. This should work for menus saved via the admin interface as well as the default menu that is ...
0
votes
1answer
337 views

Changing the text of Upload/Insert on Posts and Pages Screen

In wp-admin/includes/media.php I found this: function media_buttons($editor_id = 'content') { $context = apply_filters('media_buttons_context', __('Upload/Insert %s')); $img = '<img ...
0
votes
1answer
104 views

filter title from shortcode

Just wondering how to filter to change the current page title from a shortcode, Since shortocodes are rendering after $post. any idea to archieve something like : ...
0
votes
1answer
957 views

CSS class on last post in loop ( custom query )

I have been using this question to try to do this but I am having some difficutlty. I have a custom post type, media, and I am working on the archive-media.php template. I have it partially working ...
4
votes
1answer
462 views

Custom Rewrite Rules Not Sticking

I've written some custom rewrite rules for a special feature on http://www.pewhispanic.org/states/. States is a page with a custom page template, page-states.php. The logic for returning the right ...
0
votes
2answers
3k views

Custom post type - filter content by custom meta box content

I have custom post type with some products. I need to add some content filtering now. I have custom meta box with "author". I want to add buttons with authors that will act like categories. So let me ...
0
votes
1answer
128 views

Filtered content appears in the excerpt

I am modifying the content using the "the_content" filter. But this filtering is seen in the excerpts also. Consider the following code, function modify_content($content = ''){ return 'HELLO ...
25
votes
1answer
7k views

Passing a parameter to filter and action functions

Is a way to pass my own parameters to the function in add_filter or add_action. For example take a look in the following code: function my_content($content, $my_param) { do something... using ...
1
vote
0answers
173 views

Carrington Build: Overriding module view file not working [closed]

I am attempting to create a filter in my theme to override the view file used for the Loop Module in Carrington Build, but nothing is happening. function my_load_loop_view($view, $data) { ...
-1
votes
1answer
1k views

NextGEN Gallery: Adding drop-down menu widget to gallery view without modifying plugin code [closed]

In NextGEN Gallery, I am able to add a dropdown menu that lets users filter a gallery to only show images that are tagged with a specific ngg_tag, simply by adding this to view/gallery.php in the ...
0
votes
1answer
70 views

Wordpress doesn't load HTML

All, I'm trying to have a side navigation menu that once you click on a link it basically pulls the content of that wordpress page and displays it. I've got the following code to do this: $qry = ...
2
votes
1answer
237 views

locate_template with multiple categories?

in this example (from Wrox book), if a single-category-$slug.php file exists, it will be shown, otherwise it's the single.php file. But if we have more than one category for each post (let's consider ...
1
vote
2answers
528 views

wp_list_pages() but only show children on the branch you are on

Lets say I have this menu: Top |___ Sub 1 |___ Sub Sub 1 |___ Sub Sub 2 |___ Sub Sub 3 |___ Sub Sub 4 |___ Sub 2 ...
8
votes
1answer
13k views

Add filter menu to admin list of posts (of custom type) to filter posts by custom field values

This answer is very close to what I am looking to do, but instead I would like to specify a specific custom field and display a select menu of its available values. Thanks!
0
votes
1answer
135 views

Categorize posts on a page o the basis of category of other post on the same page

I will explain the problem more clearly. I want to create a page which will show three blocks. At the top: It will show one post . ( An issue of a Magazine. PDF in a post) At the center: It will ...
2
votes
1answer
334 views

Right way to add HTML bloginfo name using a filter

I would like to style parts of bloginfo name from a filter. The only thing I want to do is change the site-title of the blog to include HTML so that I can do individual font-settings on part of the ...
0
votes
1answer
543 views

wp_mail_from not changing from address

I wish to use the wp_mail_from hook to change the from email address submitted through a form which sends an invitation to a friend by email (I am writing my own plugin to do this). I am using the ...
0
votes
1answer
1k views

filter custom post type by meta key in dashboard

I'm looking for a way to expand e customize more this topic how to filter post listing (in WP dashboard posts listing) using a custom field (search functionnality)? I've a custom post type in the ...
2
votes
2answers
649 views

How to stop WordPress from changing ellipsis into a pre-composed triple-dot glyph?

When I type an ellipsis composed of three separate dots ..., WordPress displays the pre-composed triple-dot glyph … instead. Is there any way to prevent WordPress from substitution the three dots?
3
votes
1answer
471 views

How to apply a class to the second word in menu list item?

I want to apply a class to a word in my menu. For example, say I have a list item in my menu called "My Item". I would like to apply a class to the word "Item" so that I can style it anyway I want. ...
3
votes
1answer
85 views

How do I know if author field was changed on post save?

I'm writing a plugin that sends notifications on various post events. One of the notifications should be sent when a post is assigned to a different author. How can I know that the post author was ...
0
votes
1answer
128 views

How to Insert A List of Posts in A Category Written by the Author into the Author Archive

What I want: http://i.imgur.com/jH6Dj.png (sorry for linking out, I am a new user here so can't post an image inline) How does one list posts by an author within a category, with a count for each ...
0
votes
1answer
1k views

$wpdb->num_rows doesn't work

I'm trying to perform some checks on custom fields before they are saved on a db. So I decided to use an add_filter as it does this between browser and db. Here is my code function ...
0
votes
1answer
108 views

separate categories with comma and srounded by single quote

hello and sorry for yet another beginner question i am extracting wordpress categories form the array but i want them to be separated by comma my code is <?php $args=array( 'child_of' => 79 ...
1
vote
1answer
905 views

Problem getting single_template filter to work - I want to serve a different single.php file for posts in a certain category

I am trying to customize the behavior of my blog to serve a specific single post template based on the category the post is assigned to. I came across this filter in my parent theme which is what ...
7
votes
2answers
355 views

current_shortcode() - detect currently used shortcode

In a plugin class I want to provide simple fields for public data: email, phone number, Twitter etc. The list can be extended. See the plugin Public Contact Data on GitHub for details. To keep the ...
3
votes
3answers
3k views

How to hook wp_list_pages?

How can I hook the wp_list_pages function so that it reads a value of a custom field and displays it instead of displaying the page title?
2
votes
1answer
282 views

Change WordPress RSS link with filter?

In my theme i use add_theme_support( 'automatic-feed-links' ); to enable the rss links. But i want to create an option to use Feedburner for the main rss feed, my problem is that i don't know how i ...
0
votes
1answer
475 views

Adding tables to dashboard pages programmatically?

I think that is not possible with some actions or filters, I know that I can do it just with html and using right css styles, and of course php to achieve what I need, or to write some minde actions. ...
1
vote
2answers
200 views

What is considered a default query for the request filter?

As stated in one of the answers in this question and in the codex entry for the request filter, said filter gets called only in a default query, such as the main query used for a loop. My question ...
0
votes
3answers
174 views

Order by title without taking into account 'the'

I currently have episodes from a TV Show that feature bands playing, so for example I have: Moby The Dandy Warhols The Kooks My wp_query looks like this: $loop = new WP_Query(array('post_type' ...
3
votes
3answers
192 views

Most efficient way to search for values from CPT in Post content

I have a Glossary CPT. Title, editor, slug and featured image. I would like to add a filter to Post content (and content of my other CPT "species") which looks through all of the content in each post ...
0
votes
3answers
1k views

Can you use add_filter() inside other function?

I'm new to WordPress, and currently developing my first plugin and currently having difficulties. How I can insert the add_filter action inside my submit function? I want the add_filter action to ...
0
votes
2answers
3k views

Post Pagination Showing Same Posts Every Page

So I have this blog that filters by category Then by city. Somewhere while creating the filtration I broke the pagination which seemed to work fine earlier. It doesn't work on my homepage where it ...
-1
votes
1answer
178 views

Applying a filter to multiple loops for days ago

I'm trying to use a filter that limits the days ago loops pull posts from. My problem is that I need different day limits for certain loops on the index page and when I duplicate the filter over a ...
13
votes
5answers
6k views

single-{$post_type}-{slug}.php for custom post types

My favorite part of the Wordpress template hierarchy is the ability to quickly create template files for pages by slug, without having to edit the page in Wordpress to select a template. We can ...
1
vote
1answer
3k views

How to filter 'post_gallery' after all other filters/plugins etc

I'm trying to re-format the gallery output a bit, change default columns and link setting, as well as exclude the featured image from the gallery images. I can use *add_filter('post_gallery' ...)* in ...
1
vote
1answer
382 views

How to remove a plugin filter's priority on specific loops (custom queries)?

So I have a review plugin that is automatically sorting all my site based on the score rating. It seems here are the filters the plugin is applying globally: //Post sorting $sort = ...
0
votes
1answer
263 views

Custom Queries - Child Categories not showing up

What I'm Doing I have a cities category and normal categories. Right now I have them filtering by category, then when the user clicks a city it will filter by category AND city query_posts(array( ...
2
votes
1answer
90 views

How to change domain used when pinging sites

Without boring you with the details of "why" to keep a long story short, I need to change the domain that my site uses when it sends pings. I went and searched the WP source for where this gets set, ...
0
votes
2answers
784 views

Where exactly does the edit_{taxonomy} hook fire?

I'm at my wits end. I'm beginning a project that may involve using an action hook in WP that is not well-documented: edit_{$taxonomy} I'm trying to determine exactly when this hook runs, so I just ...
0
votes
2answers
976 views

wp_list_categories() Exclude All Categories Except One

Is there a way to exclude all categories except one? I want to show a category and it's sub-categories as a dropdown menu, but the admin might add more subcategories to it so I don't want to limit ...
2
votes
2answers
2k views

How can I remove css from a child theme?

I am using the theme twentyten as a parent theme for my child theme. I have other stylesheets I want to use and so I'm trying to figure out how to wp_deregister_style for the style.css sheet that is ...
1
vote
1answer
425 views

How can I make a search form that can search taxonomies and posts?

I have a search bar on the homepage of my theme. I want the user to be able to select from a drop down to search for everything, posts, or taxonomies. I looked at the wp_dropdown function, but its ...
0
votes
1answer
3k views

Filter Posts By Tag

I'm trying to filter my posts by category, then further by city. The only way I can think of filter by city is if the admin adds the city to the listed tags and then filtering from there via switch ...
0
votes
1answer
212 views

Add extra optional text to permalink e.g. “-with-*”

I've been scratching my head about this one for a while. I have tried to add a hook within WP_Rewrite to ensure that we can pick up pages with a similar structure: /products/product1-with-* ...
2
votes
1answer
249 views

Filter Hook Returning Blank When Used Twice

This is a pretty lengthy question, so bare with me. In a plugin I've written that allows users to easily create new meta boxes, I have a function that uses a switch() to return the appropriate HTML ...
8
votes
2answers
14k views

WordPress hooks/filters insert before content or after title

trying to insert content before the post content in my functions.php - I know how to use the regular wp hooks, but unsure how to insert into other areas. Tried this, but it kills content on any other ...