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

learn more… | top users | synonyms (5)

0
votes
1answer
576 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
749 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
711 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
200 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
753 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
807 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
240 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
367 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
84 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
550 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
526 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
6k 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
333 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
123 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
861 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
348 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 ...
0
votes
2answers
891 views

Conditional custom menu?

I'm trying to create a custom menu that displays a <li></li> when a user is logged in, and not display it when they're not. I have this so far, but it's not working. Does anyone know how ...
1
vote
1answer
454 views

Remove inline styles from the_content?

Is there a way to remove any inline styles made by the WP Editor i.e. Font Size?
0
votes
1answer
538 views

display tag slug as class per link in tag cloud

I would like to filter wp_generate_tag_cloud so each of the tag links include the slug as a class. More specifically, I would like to output "tag-" + the tag slug. Currently what is assigned as the ...
0
votes
1answer
320 views

conditional search

I am looking for help with a conditional search based on four categories/taxonomies; countries/regions/type/no of bedrooms. What I am after is a dropdown search function that when I select a specific ...
4
votes
1answer
855 views

How can I filter posts by post_parent in the admin?

I have followed this tutorial and this one to add a custom column to a custom post type edit screen, showing the post parent of each post. My question: How can I make the post parent clickable just ...
1
vote
1answer
188 views

Combining action and filter?

I tried to set up different video oembed size for content and sidebar. I can set up video size with embed_defaults filter. But this filter works for the whole site and I need to have smaller video ...
-2
votes
3answers
154 views

Apply function on all action hooks?

Is there an easy way to apply a function on all action hooks? I want to apply esc_attr() to every action hook (in a way that would work from functions.php or a plugin). I figure I would need ...
6
votes
3answers
2k views

Change admin bar to default:off

While I quite like the admin bar I actually want it to be OFF by default instead of ON ( I don't want to disable it altogether because I want users to be able to turn it on if they want - but but I ...
2
votes
1answer
692 views

Better way to enforce category hierarchy in post_categories_metabox?

The objective is to ensure that when editing a post, the metabox that lists a hierarchical taxonomy doesn't reorder itself upon Update to put checked items on top. Right now, edit-form-advanced.php ...
2
votes
2answers
1k views

How to remove “Taxonomy name:” from wp_title

The wp_title-generated <title> in my custom taxonomy archive pages contains the singular taxonomy name with a colon. I can't figure out where this is coming from (or if it's default Wordpress ...
1
vote
2answers
3k views

Need help building a filter to edit the output of “image_send_to_editor”

What I'm trying to do is edit the output of image_send_to_editor so that i can make the anchor that wraps around the image have a specific class & rel. I plan to basically make each image that ...
-1
votes
1answer
483 views

Current Post/Page Ancestor, CSS

LINK: http://themeforward.com/demo2 Checkout my menu. Hover over Features > Shortcodes > Typography. Notice how when you put your mouse over typography the background of Shortcodes turns to the ...
0
votes
1answer
643 views

Including inline Custom Fields info with add_filter in functions.php

I have a function set up to place some standard text in each post for a Custom Post Type. However, within that standard text I want to pull some unique text from a few custom fields. Not sure what is ...
0
votes
1answer
801 views

How to query posts by month based on date custom field?

I currently created a custom field for a custom post type that stores a date in the format dd/mm/yyyy is there a way to query the posts by the month? I "kind of" got the functionality I need using ...
0
votes
2answers
674 views

wp_link_pages output appears twice

I believe this is completely different than the question asked here. I'm adding pagination to my theme using a filter hook. The output appears at the beginning and end of my content, rather than just ...
2
votes
1answer
845 views

Multiple post types in archives (filter?)

I'm trying to get all custom post types to appear in my archive sections on a site, including monthly, tagged, author archives. At the moment, I've thought of something like: ...
1
vote
1answer
435 views

Pass variable to hook. Its possible?

I have this hook created to retrieve user password when he register or update his pass. I dont want my client to touch wordpress core so i was planning to use a hook in wp-includes/user.php All this ...
0
votes
1answer
905 views

Custom Register Link on Backend Form

I want a similar solution like this one for my login form on the backend of my WordPress installation: Forgot Password URL Filter What I want to do instead of returning a custom forgot password url, ...
2
votes
2answers
2k views

Get password when user registers and save it sha1 into database

im working on a website where the users can connect with iphone to some functions of it by using a sha1 encrypted password. In other words the plain password of wordpress encrypted in sha1. In the ...
1
vote
2answers
87 views

Same Conditionals Not Working on Two Different Hooks

Everyone! I am new to WP and trying to build a plugin. I have the following codes working properly: add_filter('the_content', 'say_hello'); function say_hello($content){ if(is_single() || ...
5
votes
1answer
4k views

How to appending to the_content using add_filter with custom post type?

I have a custom post type running fine, but some of the text in the page is the same for every post, so I want to add it in using a function. I have this set up: function ...
0
votes
1answer
4k views

add_filter for specific pages

Is it possible to add this filter add_filter("the_content", "magicalender_get_event_page"); But only for one specific page, for example if($post->post_name == "magicalenderpage") If I put the ...
0
votes
1answer
307 views

Help with add_filter('the_content', 'some_function') and multiple matches

I have a site where a user can insert slideshows into a post by entering the shortcode in the content box. He can also add videos by adding the video code in the same box. I need to separate these two ...
0
votes
1answer
124 views

output custom Posts on a Page

I'm trying to write a function that will output a set of posts on a page. Because I want to display more than just the post titles, wp_get_archives() won't do (I think). The function to add the post ...
3
votes
3answers
2k views

How to publish a post with empty title and empty content?

Why I'm doing this you might ask? I'm developing a website for a business with a portfolio where the gallery items are posts. These posts are populated through custom fields and category selections, ...
1
vote
2answers
672 views

How do I add a TinyMCE row that all users can see, instead of just admins?

Currently I have successfully added a row of shortcode buttons to the TinyMCE editor in WordPress. The problem is, only admins can see the row, and I need contributors and editors to see it too. I ...
4
votes
1answer
220 views

Why, Where, and When to use reference pointers in filters/hooks?

Why, Where, and When to use reference pointers in filters/hooks? What are the potential cons of not using them when suggested or required? Just looking for a more detailed answer than the codex ...