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

learn more… | top users | synonyms (5)

2
votes
2answers
225 views

remove_filter( 'comment_author', 'floated_admin_avatar' ); doesn’t work

In a small plugin I’ve written to add an IP address column to the comments list I want to remove the avatars. In line 156 I tried to use remove_filter: remove_filter( 'comment_author', ...
0
votes
1answer
393 views

category filter doesn't work

I am assuming because I don't have a category template it is defaulting to the archive template, would that affect the outcome. it seems to output all the posts that have categories: ...
0
votes
1answer
146 views

Taxonomy search filters

I have developed an educational courses database of several countries using several taxonomies. Country, institute, study level and some other are taxonomies. If user click on some country, all ...
3
votes
2answers
579 views

How to add filter to __() and _e()?

I would wish to add a filter to _e() and __() functions. The filter is FilterTextOfEmail(). This will basically detect any emails and add anti-spam method to it. I assume, the function for filtering ...
0
votes
1answer
375 views

Modify posts listing at back end

I want to modify posts listing at back end? Say, for a particular user, with role author, O want to list only few posts at posts listing. How can I do this?
-1
votes
1answer
70 views

Removing title from page

Hello attempting to remove the title from static front page using the following code is (not working) in my functions.php function remove_page_title() { if (is_front_page() ) { add_filter( ...
0
votes
2answers
1k views

Removing strip_tags not working on nav_menu_description

So I'm adding descriptions to my site's main menus. Checked the box, added the text. Dropped in a custom walker in functions.php. Dropped in a wp_nav_menu call in header.php to call the custom walker. ...
2
votes
1answer
211 views

Some questions regarding filter

1) Take a look at this example add_filter( "xxx_xxxxx", "blah_blah" ); function blah_blah(){ echo "filter added"; } xxx_xxxxx can be anything like my_filter or it should be one of the ...
0
votes
1answer
284 views

How to add a filter to the get_body_class function?

I see it is possible to use add_filter with the body_class function, but I'm needing to add one to the get_body_class function. How can I add a filter to a function that is not included in the list ...
3
votes
3answers
2k views

How to remove Filters from post admin page?

On a custom post type, I want to remove the filters that show up on /edit.php (where all of the posts are listed out). I have a custom taxonomy that shows up as a filter that I WANT to keep, but I ...
0
votes
1answer
1k views

Help With issue on pre_get_posts filter in taxonomy

I create a function to filter the taxonomy query with this code add_action('pre_get_posts', 'custom_taxonomy_query'); $option_taxposts_per_page = get_option('tax_posts_per_page'); function ...
14
votes
3answers
5k views

remove_action or remove_filter with external classes?

In a situation where a plugin has encapsulated its methods within a class and then registered a filter or action against one of those methods, how do you remove the action or the filter if you no ...
1
vote
2answers
2k views

What is the filter hook for custom fields content?

The following code hides "the_content" output add_filter( "the_content", "cp_module_pcontent_post_content" ); function cp_module_pcontent_post_content($content){ global $post; ...
1
vote
3answers
5k views

How can I edit post data before it is saved?

I have a plugin and I would like to be able to run the post content through some filters before it is saved to the database. From looking at the plugin api, I see that two hooks that look like they ...
2
votes
1answer
56 views

How can I show more than 15 themes at a time in the admin menu?

I have a lot of themes in my test wordpress site. I get a little frustrated that I can't show more than 15 at a time. In pages and posts you can click "screen options" to choose the number, but it ...
0
votes
1answer
563 views

Filter search posts by post meta?

I'm working with a custom post type with custom taxonomy and custom fields and trying to filter the displayed results (on admin post listing page) by the custom field values... I've been trying to ...
0
votes
2answers
893 views

Add mime types with plugin

I've tried a few plugins to add mime types including the PJW Mime Config plugin. And adding this to a themes functions.php file would work fine, too, for a non-WPMS site. But I need these to be ...
1
vote
2answers
244 views

Excluding specific widgets from default sidebar class

I have two sidebars using the register_sidebars function that display each widget as a list item with a class of .box: <?php if(function_exists('register_sidebars')){ register_sidebars(2, array( ...
1
vote
1answer
131 views

How to find the origin of a file upload from within wp_handle_upload?

I have a plugin that hooks into "wp_handle_upload" filter. Within that scope I'd like to be able to identify where the upload came from, meaning I want to treat it differently if it was uploaded from ...
0
votes
2answers
222 views

How to make modifications only to certain elements of an HTML string on the server-side?

Is there a similar way to select / perform DOM manipulation on the server-side (PHP) like the way jQuery works? For example, if I wanted to modify content of each <pre ...
1
vote
1answer
1k views

How to display posts under a specific subcategory of a given category

after a long search online I have decided to post my problem here in the hope of getting a solution to this issue. Well, I have a custom post with various categories (novels, books, magazines etc..) ...
1
vote
1answer
335 views

How do I alter the comment form 'allowed tags' text in a plugin?

I'm using the PHP Markdown plugin, and I'd like to modify it so that it adds some text to the bottom of the comment form indicating that Markdown is supported in comments. I've been modifying my ...
0
votes
1answer
145 views

Modifying search results based on post_type

Is there an easy way to highlight search results based on post_type? I am using Job Manager plugin and when a site search is performed, I want to simply add a note e.g. (Job) next to the Job Results. ...
0
votes
1answer
116 views

Are href attributes of a elements filtered on output to add the current path?

I have some code that basically looks like this (it's more complicated, but even this example shows what I'm running into): echo '<a href="#">TEST</a>'; However, what gets sent to the ...
0
votes
1answer
76 views

Any adverse effects of adding apply_filters to a function?

I'm going back through my older WordPress theme and making the functions filterable and also adding the function_exists checks. Is there anything I'm not thinking about that this may cause problems ...
1
vote
3answers
1k views

Wordpress 3.2(Multisite) - How to add custom user meta fields to signup form?

I want to add custom user meta fields to registration page. I use WP multisite so I have to modify wp-signup.php. Adding some field is easy for me(I am programmer :P). But I have a problem with this ...
0
votes
1answer
185 views

get_image_tag filter not working

I'm trying to get the custom field data off an attachment and display it following the image tag in a page/post using the get_image_tag filter. I'm using the same function to get the same data and ...
0
votes
1answer
579 views

Anonymous function is executed twice in wp_head while added from the_posts filter?

I know this sounds complicated, so bear with me. I'm trying to add certain custom css styles based on the shortcodes(if any) in the current post/page. function load_shortcode_styles($posts){ ...
1
vote
1answer
767 views

Changing bloginfo description from a plugin

How can I change the site's bloginfo description in runtime from a plugin? I tried these, but none of them work: add_filter('description', 'ab_arq_generate'); add_filter('blogdescription', ...
6
votes
1answer
7k views

Removing Image and Caption Dimension Attributes

This question is an offshoot from the this discussion on removing dimension attributes from images. The solution code provided on that thread works very well except that it has the unfortunate side ...
3
votes
4answers
726 views

Run shortcode before filters

My users post snippets code in comments. I created a shortcode for this : function post_codigo($atts,$content=""){ return '<code>'.$content.'</code>'; } ...
0
votes
2answers
204 views

Joining tables not working in the post editor page

I am developing a plug-in which stores data in a custom table and is joined onto the wp_posts by the post's the id. I then use the posts_join and post_fields filters to join my table and be able ...
1
vote
1answer
787 views

Is it possible to Hook/Filters Attachment Creation?

Is it possible to hook or filter the attachment creation process? More specifically is it possible to hook into the attachment creation so that I may parse the attachment’s filename, populate the ...
1
vote
1answer
831 views

Wordpress Search Filter Only for Page with Child of Child of Child of Child of Child

after browsing question from this site I found the workaround for this: function SearchFilter($query) { if ($query->is_search) { global $post; $query->set( 'post_parent', 21 ...
1
vote
1answer
2k views

How I got jQuery Quicksand working with WordPress?

I have been tryin to make this plugin work but I failed badly. I have the code like below: The portfolio-terms is filtering buttons: <div id="portfolio-terms"> ...
0
votes
1answer
241 views

Can I change the “Home” text in the menu?

I’m pretty sure this can be done with a filter or some kind of find and replace, but I’m not sure how. I have a page called “Home” like so: When the link is displayed in my template it says ...
1
vote
1answer
371 views

Query posts from category based on a filter most favorited

I have one question. I need to query posts from category based on the filter most favorited ( http://pastie.org/2751114 ) which is placed in custom_sort.php to my index.php page This is how the posts ...
1
vote
1answer
182 views

How to take options from form fields and turn them in to links?

I have a form in WordPress with options when clicked they retrieve a filtered posts. I want to take the options from the form and place it like normal links. Can this be done? Thank You all in advance ...
1
vote
1answer
85 views

Add filter problems

I am confused about filters, why does this work: function get_the_author_description2() { return 'test'; } add_filter('get_the_author_description', 'get_the_author_description2'); but this one ...
0
votes
1answer
559 views

Filter media upload attachment meta

I'm trying to determine a way to access the meta data for an image when it is first uploaded with the media uploader. Looking at the media_handle_upload() function in /wp-admin/includes/media.php I ...
0
votes
1answer
531 views

How can I apply filters in my class that extends Walker_Nav_Menu?

I have the following piece of abridged code: <?php class New_Walker_Nav_Menu extends Walker_Nav_Menu { function start_el(&$output, $item, $depth, $args) { $attributes = ! empty( ...
4
votes
2answers
7k views

Dynamically exclude menu items from wp_nav_menu

I tried looking for info about how to exclude/remove nav menu items from custom menus, and the only thread I found did not have any answers that were useful to me. 1. Background: I put together a ...
2
votes
1answer
335 views

Hook different functions to the same filter conditionally OR Pass additional arguments to existing filter?

Is it possible to hook 3 different functions to the same filter conditionally, like: <?php if(a){ add_filter('the_content', 'fnc_1'); } else if(b){ add_filter('the_content', 'fnc_2'); } ...
1
vote
0answers
124 views

include a post unrendered into a post, then render the whole thing [closed]

With a few extra lines in my functions.php I've created a shortcode that lets me include the content of a post: function include_content( $atts ) { $id = (int) $atts['id']; if ( ! $post = ...
1
vote
1answer
870 views

How to remove attachments size attribute [duplicate]

Possible Duplicate: Prevent Width and Height Attributes in Image Tag Output i would like to remove the width="512" height="128" attributes on an attachments this method is fine on images ...
2
votes
1answer
3k views

Overriding The Loop with filter or hook

I'm trying to replace the $wp_query object for a specific category, without having to deal with creating a new template and creating a new WP_Query object there. My aim is to change the data ...
0
votes
1answer
351 views

Where is the content cache when using apply_filters('the_content…?

The following code block is giving me an accumulated result: foreach($sections as $section) { $content_post = get_post($section->ID); $content = $content_post->post_content; ...
2
votes
4answers
2k views

How to change wordpress post title?

How to change just wordpress post title but not menu items. add_filter('the_title', 'wordpress_title'); function wordpress_title(){ return 'New title'; }
3
votes
1answer
3k views

How to use the_excerpt in a filter hook?

I was hoping to process the_excerpt just like one would with the_content, but no such luck. How can I pass the excerpts of a Posts Page, through my plugin? I've tried variations on this: ...
3
votes
1answer
1k views

Update post counts (published, draft, unattached) in admin interface

I am working on a multi-user WordPress setup and have made it so a particular type of user can only see and interact with posts, images, pages etc that they have authored. The code to make this happen ...