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

learn more… | top users | synonyms (5)

1
vote
1answer
487 views

Can't filter wp_get_attachment_link

Can't figure out why this won't work: function my_get_attachment_link($html){ $postid = get_the_ID(); $html = str_replace('<a','<a rel="shadowbox['.$postid.']"',$html); return ...
-1
votes
1answer
113 views

if i put the code in my theme's function.php file can it work?

$gr_preview_theme = $_GET['preview_theme']; $gr_preview_css = $_GET['preview_css']; if (! $gr_preview_css ) $gr_preview_css = $gr_preview_theme; if($gr_preview_theme && ...
2
votes
1answer
1k views

Hijacking the URL for filtering

Right, here's the deal. I've got a loop of which displays news posts, these posts can belong to special categories (not normal categories) and I want to be able to filter by them. If I wasn't too ...
7
votes
1answer
553 views

Assign a Class to the Current “Tag” for Formatting

Essentially what I am hoping to replicate is something like the "current-menu-item" class that is applied to WP Menus. My client is wanting to use Tags as a sub-nav, and I've managed to get the tags ...
2
votes
2answers
4k views

Add_Filter example for wp_get_attachment_link

Let me preface by saying I don't really understand Add_Filter, but I think that I want to be using it here. If not please let me know. I want to modify wp_get_attachment_link so that the link url ...
1
vote
1answer
320 views

Wordpress Post # of # filtered by category slug

I want to show post #4/100 at the top for each post for which I'm using following code function updateNumbers() { /* numbering the published posts: preparation: create an array with the ID in ...
3
votes
1answer
901 views

get_option() filtering and getting out of recursion

get_option() provides couple of filters 'pre_option_'.$option and 'option_'.$option. However most times I tried to make use of these it usually explodes and not worth the trouble - either I need to ...
12
votes
2answers
7k views

Explanation for apply_filters function and its variables

I'm learning how to build html forms using PHP by taking an example from "simplr form registration" plugin. I'm looking at this code: $form .= apply_filters('simplr-reg-instructions', __('Please ...
0
votes
3answers
2k views

get variable from url?

say i've got a url http://bfami.modernactivity.co.uk/category/museum/orderby/date/order/desc/ that works with; add_rewrite_rule( ...
2
votes
1answer
550 views

Apply class to every paragraph that holds image?

Hey guys, When adding an image to a page or post wordpress is automatically adding a paragraph tag as parent holding the image. since there is no parent selector in CSS I'd love to find a solution ...
1
vote
2answers
1k views

Filter Home Page Posts in Buddypress

I would like to remove blog posts from the home page if they belong to a certain category. How can I go about this in Buddypress (preferably without a plugin)?
5
votes
5answers
4k views

Remove classes from body_class

I don't need this whole mess of classes like this... <body class="page page-id-829 page-template page-template-page-template-portfolio-php portfolio"> I'd like something like this... <body ...
0
votes
1answer
248 views

BuddyPress - A hook available to hide custom born date on public profile view?

I'm trying to hide some fields on public BuddyPress profiles, it is possible? Thanks in advance.
2
votes
1answer
734 views

what is __return_false in filters

I was thinking of removing/hiding admin-bar from my wordpress (3.1.1) installation. I visited following link: http://codex.wordpress.org/Plugin_API/Filter_Reference/show_admin_bar I was surprised ...
3
votes
2answers
1k views

Allow html tags in WordPress Custom Menus Description Field

I added descriptions to my menus using this post, Menu items description?. However I need to be able to use html tags and WordPress is stripping them out. Can anyone help?
0
votes
1answer
135 views

How-to inspect filter-able $vars?

Note: This is more of a tutorial/wiki than a real question and should be a reference for later Questions. If you got something to add, please feel free to add an answer. Working answers get upvoted. ...
0
votes
1answer
232 views

What's the best way to echo out a filter variable?

I have a plugin filter that isn't working for me: add_filter( 'gform_notification_email_3', 'route_notification', 10, 2 ); function route_notification($email_to, $entry) { global $post; ...
1
vote
2answers
212 views

Widget Area: Modify $param['xy'] from widget-$n

I have different widget areas. One is a horizontal area that may contain eg. 4 widgets next to each other. My Question is how would i add a different eg. $param['widget_title'] to widget number $n ...
0
votes
1answer
264 views

wordpress is automatically linking plaintext email addresses

Hey guys, I'm using the latest version of wordpress (3.1.1). Is it just me, or is wordpress now automatically linking plain-text email addresses? I type jdoe@email.com as a comment and it shows up as ...
7
votes
1answer
3k views

Row actions for custom post types?

I'm working on a plugin, which converts a site into a feedback sort of portal. I made a new object page, 'Feedbacks', which displays all the feedbacks is a tabular format, and I'm using ...
0
votes
1answer
102 views

Pre-existing arguments when using queries

I am struggling to understand how queries work with get_posts(), query_posts() and WP_Query(). In particular I do not understand what pre-existing selection may exist when using these on a given page ...
1
vote
1answer
2k views

add_filter to youtube embeds?

hey guys, when posting a youtube video link in the backend (in a post or a page) wordpress is automatically creating the embed code for me. Is it possible to add a filter to that? I'd love to change ...
1
vote
1answer
3k views

adding a filter to a shortcode?

<?php echo do_shortcode('[mingleforum]'); ?> inserts the mingle forum into my content! is it possible to use add_filter() on that?
11
votes
6answers
14k views

remove empty paragraphs from the_content?

Hey guys, I simply want to prevent the creation of empty paragraphs in my wordpress post. That happens quite often when trying to manually space content. I don't know why this doesn't take effect? ...
1
vote
1answer
208 views

get_bookmarks filter not supplying query argument (wp 3.1)

I'm using a filter on the get_bookmarks function. When I use two arguments in my filter function I get the result array and nothing for the second arg (it should be the parsed query). Here's what I'm ...
5
votes
3answers
1k views

Is there a way to add another row to the tinyMCE kitchen sink toggle?

The tinyMCE "kitchen sink" toggle button shows/hides a row of buttons. I have successfully added my row of shortcode buttons to the tinyMCE editor, but I was wondering if there was a way to make my ...
1
vote
1answer
312 views

remove inline scripts from the_content() produced by plugins?

hey guys, any idea how I could filter all inline javascripts from the content()? thank you
0
votes
3answers
751 views

What hooks to hook onto for automatic cache clearing

I have a WP-site with not that many writes, but quite a few reads and a few specific hotspots in the templates that I'd like to cache pretty aggressively with my own PHP-caching mechanism. I could ...
1
vote
2answers
3k views

How do I add a listbox to the TinyMCE editor?

I am having trouble adding a list box to the TinyMCE editor in Wordpress. I have already read entirely through this question but it did not get me all the way there: How i can i add a split button or ...
1
vote
1answer
1k views

When adding buttons to the tinyMCE editor, how do I make them wrap to the next line and/or display in the “Kitchen Sink” area?

I'm successfully adding buttons to the TinyMCE editor in Wordpress, but the problem is they all show up to the right of the Kitchen Sink button and I have so many that I need them to display on a new ...
0
votes
4answers
2k views

Remove Page Title from Static Frontpage

I'd like to remove the post title from my static frontpage. Just that page. I've created a child theme from a free Press75 theme. So I'd like to make this change in my child theme's function.php. I ...
1
vote
2answers
541 views

problem with implementing widget via the_content()

hey guys, I really need you help with this one. I'm using the subscribe2 Plugin (for email subscriptions). I want to show the signup form as a widget. The plugin author recommends doing it the ...
2
votes
3answers
5k views

Moving sharedaddy buttons (in Jetpack) to the top of a post?

How would one move the sharedaddy buttons included in Jetpack to be placed before a post's or page's content, rather than after it? I see that in sharing-service.php the function that prints the ...
2
votes
2answers
2k views

What params are available with the_content filter?

I am looking for what params are passed to my filter function. Where can I find such info in the codex? http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content didn't provide much info I ...
1
vote
1answer
1k views

hooks & filters and variables

I was updating the codex page example for action hooks, while playing around to get some reuseable functions done (originally for some Q over here @WA). But then i ran into a problem i wasn't aware of ...
1
vote
3answers
726 views

Possible to filter the posts or categories that XML-RPC users see in their mobile application?

Is it possible to filter the posts or categories that XML-RPC users see in their mobile application? I have a plugin that hooks into pre_get_posts and list_terms_exclusions to do what I need it to ...
1
vote
1answer
2k views

Using 'posts_where' on a query with a custom field

I have a page which displays tour dates for an artist. I use a custom field (TheDate) to give each entry a numerical value so that they will show up in the proper order (regardless of when they were ...
3
votes
3answers
2k views

Loading template files from a subfolder in my theme?

I am working on a site that will have up to 30 templates in it. I don't want to have all those templates at the root of my theme folder cluttering up everything. I know how I can modify the ...
2
votes
1answer
430 views

PHP5, Inheritance, Singleton - action & filter hook limitations

I'm currently working on a plugin, which uses the builtin cron functionality of wordpress. Instead of using PHP4, I want to use PHP5 with inheritance and the singleton design pattern. I run in some ...
2
votes
2answers
3k views

Filter the URL of next_posts_link & previous_posts_link

I am working with the qTranslate plugin to create a multi-lingual website. The plugin does a great job of translation except for on the next_posts_link & previous_posts_link template tags. When ...
4
votes
5answers
638 views

Implementing advanced add_* function wrappers

add_action() and add_filter() are major functions. However in some scenarios add one more function and hook it somewhere approach gets bulky and inconvenient. I had determined for myself several use ...
2
votes
1answer
368 views

There's some way to add a wrapper around posted images?

I need to add a wrapper (I'll use <figure> in my example) around images posted through the editor, with a variable depending on the size image is being posted (thumbnail, medium, large, full), ...
1
vote
2answers
9k views

how to display post content without post image?

i've implemented a jQuery gallery for displaying several images within a post. the problem is that the_content(); also displays the post image. any ideas how to filter it? thanks
2
votes
3answers
1k views

Add parent template name to body class filter when visiting subpage or single post

how would I go about creating a filter for the body_class() tag that allows me to add the the parent pages slug name as a class to the body whenever visiting a subpage or post?
1
vote
3answers
4k views

add_filter to post-gallery and remove all <br>'s?

hey guys, i really need your help. Whenever I use a gallery in wordpress and set it's columns to just 1 Wordpress automatically adds <br style="clear: both"/> after every <dl ...
4
votes
2answers
2k views

How to add a filter to all widget output

Is there one last filter that is ran over the widgets before they are sent out to the browser? I would like to add a filter that adds rel="nofollow" to all links in all widgets. For instance, I can ...
0
votes
2answers
781 views

Filter or order based on custom field

I have added a custom field to some posts called 'frontpagerank' The plan is to order the posts by this value but first I just want to filter out any that don't use a front page rank. I have achieved ...
1
vote
1answer
3k views

Add Custom Filter to Admin User list

What is the correct way to add a custom filter (a dropdown box in this case) to the admin user list (wp-admin/users.php)? There are no filters or actions that I see to hook into that would allow me ...
0
votes
1answer
1k views

recent comments filter by author, page, category

is there any way to display recent comments in a widget area only for one page? = Comments that are belongs to one page. comments of one category but not from admin ( or some other user ) I want ...
4
votes
3answers
9k views

Filter by one custom field, order by another?

I have a custom post type "Listing" and I want to get all Listings that have a custom field gateway_value != 'Yes', and order the results by another custom field, location_level1_value. I can get the ...