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

learn more… | top users | synonyms (5)

2
votes
1answer
190 views

Proper use of the_content filtering

This is a bit difficult without posting scads of code, but my question is: What are the benefits of filtering through apply_filters('the_content', 'anything');, and given my example loop, am I ...
1
vote
1answer
45 views

How to return only one instance of each, from the entire loop

I´m adding a filter function in a taxonomy archive template. The intention is to add URLs for filtering in a sidebar, and i want it to return a set of ACFs like zipcode etc... (postnr in this example ...
1
vote
1answer
33 views

Filter Posts from the Main Query

I want to conditionally merge a custom post type with my posts post type, based on a custom field. If the field's value is 1, then I want I need those custom posts to appear in the same loop as posts ...
1
vote
1answer
83 views

post_row_actions filter is not working while update post using quick edit

I have created two links using post_row_actions, it was displaying fine when page loads. But the links will get disappear after update post using quick-edit. Is it a bug from WordPress or did I miss ...
1
vote
1answer
86 views

Filtering the post list in the admin area

How can I filter my custom post type like it's filtered by WordPress itself? By that I mean the links that allow you to show only published, private or trashed posts. I need it because I want to ...
1
vote
1answer
119 views

Add Lightbox To WordPress Native Gallery

Is there a way to check if a gallery is linked to an attachment page or to an image file via jQuery or WP filter? I'm trying to add a lightbox to gallery image that is linked to image file. But I ...
1
vote
1answer
85 views

How to use manage_$post_type_posts_columns with underscore in post type?

I have a post type 'job_listing' and I want to use manage_{$post_type}_posts_columns filter in it. I tried manage_job_listing_posts_columns but it's not working because of the underscore in the post ...
1
vote
1answer
369 views

Using add_filter() in Widgets

Just have a query reference the add_filter() function. Can you use this function inside a WordPress widget class. Example I have a widget with dynamic created code that I want to pass to another ...
1
vote
1answer
647 views

Only let plugin add actions to wp_head & wp_footer on single posts

I'm using a a plugin (Comments Evolved) on a recently built site. The issue I'm having is that this plugin globally enqueueing and adding actions to the head and footer of all pages. I'd like to ...
1
vote
1answer
191 views

How can I replace an oEmbed URL in post with actual embed HTML

What I want is to get the output of the Twitter oEmbed system into my actual posts. IMHO the embed output itself is high-quality, semantic HTML and I'd rather have it inside the post than in the embed ...
1
vote
1answer
160 views

Set Item Order with wp_nav_menu_{$menu->slug}_items

I have some code that adds a menu item to a menu using wp_nav_menu_{$menu->slug}_items. It's pretty easy to add a menu item as the first or last item of the menu, but I was wondering if there's ...
1
vote
1answer
172 views

add img class to native wordpress galleries

Trying to add an img class = "the image alt field" to the images in a native wordpress gallery so i can use jquery isotope to filter the gallery. I could use the image alt field or the description ...
1
vote
1answer
209 views

list category posts under its item in menu

When adding category to Menu, I need it to list all the item that belong to that category in separate UL automatically. like this http://i.stack.imgur.com/ulOOS.jpg Of course I can do that manually, ...
1
vote
1answer
248 views

display only the wp_nav_menu, which has the current-menu-item

i have a problem displaying only the menu with wp_nav_menu, in which the current-menu-item is in. Heres what i got: function register_menus() { register_nav_menus( array( 'sidebar-menu' ...
1
vote
1answer
2k views

ajax for filtering posts by category in wordpress loops

I've been looking around for a way to filter my posts on http://www.waziproject.com/wazimagazine/ without reloading the page. So my question is if anyone can help me out to turn the following into a ...
1
vote
1answer
107 views

Give “Read More” precedence over excerpt() word count

By default, the_excerpt() displays the content before the <!--more-->, trimming it at ~50 words. Is there any way to prevent this trimming functionality when the <!--more--> is present, ...
1
vote
1answer
138 views

Admin comments and user restrictions

I have set a bunch of roles within wordpress with the help of the "members" plugin. But the capabilities regarding the comments moderation are very limited ("manage_others_comments" or not) What I ...
1
vote
1answer
110 views

Wordpress Image update filter

I can't seem to find the filter for an image update. Right now I have the code below, which works great until someone clicks on an image in the editor and updates it. Then it throws the height and ...
1
vote
1answer
51 views

Run wp_kses_decode_entities on atom feed?

I would like to convert the htmlentities in only my atom feed to their corresponding characters. Using the below in my functions.php I've gotten close, but obviously the commented out line doesn't ...
0
votes
1answer
88 views
+50

Custom Taxonomy breaking pages permalinks

I'm stuck for some days with this problem and I don't know what else to do. With %somethingHere% on slug rewrite, pages permalinks are broken (CPT AND CT OK). Without, I don't have my desired Post ...
0
votes
1answer
66 views

How add a group by to the query used by the media library?

What would be the proper way to add a group by to the media library query? What I have tired so far is not working: add_filter('posts_groupby ', 'limitMediaLibraryItems', 10, 2 ); function ...
0
votes
1answer
21 views

Pass A Value From Outside To A Plugin Variable

Is there a way to pass a custom variable value from outside like from functions.php to a plugin's variable? Lets say that I have the following function defined in a plugin. function plugin_funct(){ ...
0
votes
1answer
16 views

Settings in functions.php used by a plugin

I'm writing a simple plugin and want some settings in an array in the functions.php file. I'm thinking of adding this in the theme functions.php $test = array('haha' => 'hehe'); my_function( ...
0
votes
1answer
22 views

Add posts to WP Query object

I need to filter the WP_Query object by adding some posts to it. I have the posts id's (from another SQL query). What would be the way to add (merge) new posts into the WP_Query object?
0
votes
1answer
19 views

Use a filter from a class function?

How can i use add_filter within a class function? this doesn't seem to work class ClassA { .... function my_custom_upload_dir($dir) { return array( 'path' => ...
0
votes
1answer
19 views

Execute filter in theme as last

Is it possible the execute the called add_filter in theme after all plugins they've been loaded? I use one of the plugins from repository to can add the ability to define custom target links for ...
0
votes
1answer
55 views

How to add a custom filter in functions.php

I have been through the Wordpress codex but I can't figure out how to write a filter. I would like to use a filter called: 'wpseo_sitemap_' . $filter . '_change_freq'. It expects you to return one of ...
0
votes
1answer
55 views

Custom Search Template for Custom Post Types

I know this is asked a million times, and I've found the solution. It seems fairly straight forward but it's not working for some reason. I wonder if it has something to do with the fact that I'm ...
0
votes
1answer
29 views

remove_action conditionally for Custom Post Type - not working

I'm using a Genesis child theme with the 'Genesis Co-Authors Plus' which enables support for 'Co-Authors Plus' I'd like to disable the author box everywhere except for the blog. Genesis Co-Authors ...
0
votes
1answer
51 views

Add rel to all images in a post

I want to add a rel to all images in a post. I am trying following filter but it will wrap only the images which are in the gallery. It does not wrap the images which are added individually without ...
0
votes
1answer
44 views

How to add a filter conditionally based on page related Conditional Tags

I am developing a WordPress plugin and can't conditionally add filters based on the conditional tags. This is my code: add_Action('init', 'determine_location'); function determine_location() { $d = ...
0
votes
1answer
76 views

change attachment custom field onChange event

The form is in post creating window. Ajax is posting values, but the values doenst renews. Where can be problem ? Ajax <script> function dynamic_Select(field, aid, value) { ...
0
votes
1answer
44 views

Adding to an array & passing it through do_action/apply_filters

For exercise I am working through a PHP class to add meta boxes I found on GitHub. I just copied the code and now I am playing around with it to understand it. It works like this: The file ...
0
votes
1answer
40 views

Access post ID in “content_save_pre”

First time poster, pardon my mistakes. I am trying to use the content_save_pre filter to grab a URL in the first line of a post and save it into a custom meta, and also set the post format as a link. ...
0
votes
1answer
32 views

Custom Permalinks and filters?

Ok, so I've added a custom permalink, which is mapping to my page fine. For some reaosn though the filters I've added aren't showing up. In the shortcode, they're just being returned as NULL. My code ...
0
votes
1answer
70 views

using posts_where for meta data on pre_get_posts

Let's say you have some code which filters posts by using pre_get_posts e.g. add_action( 'pre_get_posts', 'be_exclude_category_from_blog' ); function be_exclude_category_from_blog( $query ) { ...
0
votes
1answer
820 views

AJAX filter posts on click based on category

This is my first foray into AJAX, I've been splicing bits of code from various tutorials which probably hasn't helped. I have a list of categories on my homepage (index.php) and a list of the most ...
0
votes
1answer
280 views

Filter to hook into menu <li> items and add a custom attribute

I'm using Foundation as a base and starter theme. I'm trying to build and I can't seem to figure out how to hook into the menu that WordPress outputs and add a custom attribute to that menu's ...
0
votes
1answer
67 views

passing '&' in return function of add_filter

I have below line in my return function of add_filter in wordpress. add_filter('the_content', 'my_drama_func'); function my_drama_func () { return "function getthrough() { jQuery.ajax({ ...
0
votes
1answer
76 views

Add Class to a div using a filter?

is it possible to add a dynamic class to a div using a filter in the functions.php? I know it's possible for the body-tag - also for a custom defined div with an id? if ( !is_search() ) { ...
0
votes
1answer
59 views

How to add a filter to get_the_author_meta?

I need to filter calls to get_the_author_meta() but I haven't been able to do it. I'm using a plugin which uses this function: get_the_author_meta('display_name', $p->uid)` I need to be able to ...
0
votes
1answer
27 views

Filtering more than one term in a taxonomy in WP

i have a custom post type called 'events', it has a taxonomy named 'category' structured this way: hotels (parent) -1 star (child) -2 stars (child) -3 stars (child) location (parent) ...
0
votes
1answer
44 views

Print all inline styles to head

Currently working on a project here http://palanquin.shrimp-works.com. When I try to validate what I have done so far, using http://validator.w3.org/, I get lots of this error Element style not ...
0
votes
1answer
93 views

Select All not working in a WordPress search filter

I am trying to create a Search Filter within WordPress to filter through all the custom taxonomies within a Custom Post Type. I have created a function that generates the dropdown so I can output ...
0
votes
1answer
19 views

Filter the HTML content of plugin

I am using the Marketpress plugin. I want to modify single_order_funct() function HTML content in it. I want to make changes so that, when it is updated, I don't lose them. class PluginClass{ ...
0
votes
1answer
23 views

Activate short codes for all post queries?

I need to use shortcodes on widgets and various plugins. For widgets I simply used: add_filter('widget_title', 'do_shortcode'); add_filter('widget_text', 'do_shortcode'); However I cannot figure ...
0
votes
1answer
63 views

change output location of plugin function using a custom hook

I'm running the YouTube Video Fetcher plugin and it fetches youtube videos and displays it on your website. However, instead of displaying the video after the post, I want to hook the code into a ...
0
votes
1answer
111 views

filter single_cat_title avoiding the breadcrumbs

I'm developing a simple plug in and I need to filter single_cat_title in category page adding some html in every category page. Just doing this: function subtitleCategory ($title) { return ...
0
votes
1answer
62 views

Problem with login form

I'm having a problem with the login form for a site I've inherited, wherein only certain users are sent to the correct page after logging in. On this site, users with accounts are allowed into a ...
0
votes
1answer
86 views

Save something to global var in add_filter

I am here again with a strange question. First, I'm using ACF plugin for adding cistom fields. My code looks somethink like that: global $testMe; $testMe = 0; function my_acf_update_value( $value, ...