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

learn more… | top users | synonyms (5)

0
votes
1answer
39 views

Updating User Profile on Registration

I am having trouble getting WP to update a custom profile field when a user registers. Adding the fields works fine. Nothing is inserted into the depositAddress profile field when a user registers. ...
0
votes
1answer
125 views

How to use add_action for multiple instances of the same class

I'm writing a plugin which defines a class that is meant to be called multiple times. The class uses add_action to register it's own methods as callbacks. class MyClass { __construct($foo) { ...
0
votes
2answers
179 views

Can i use multiple 'the_content' filters?

I am currently using a 'the_content' filter to add some HTML to the bottom of my posts and pages. But, I want to add another 'the_content' filter to a handful of specific pages (using page IDs). Is ...
0
votes
2answers
561 views

How to filter the_content() & include content from template

I am trying to filter the_content() on single page, but it looks like it is creating an infinite loop. I want to know how to fix this. I want to override the_content(). Is there any other way to ...
0
votes
0answers
21 views

Modify images when inserted in to WYSWYG Editor

When an image get added it currently adds <a href="www.domain.com/image.jpg"><img src="www.domain.com/image.jpg" /></a> I am aware that user can directly add the link. However the ...
0
votes
1answer
650 views

Display WooCommerce newest product reviews on top [closed]

By default, woocommerce product reviews are listed in chronological order. How do you get the newest review to appear first?
0
votes
1answer
36 views

Restrict a filter to a custom post type. Am I doing this right?

So I had this little bit of code to short a music charts custom post type that all starts with numbers (the trick was to make the 10th position appear last in the list, not between 1 and 2): ...
0
votes
1answer
28 views

Is this correct usage of filters in WordPress [closed]

I am building a plugin and I'm getting doubts whether the code I am using is the correct way of doing things with regards to WordPress hooks and filters. The scenario is that the code at a particular ...
4
votes
3answers
166 views

How to restrict actions and filters “properly” by conditions

Which one is correct when adding actions/filters/etc.... Both methods work fine and I've seen people do things both ways, but I'm assuming one is correct. My gut tells me that wrapping the if ...
1
vote
0answers
39 views

Filter categories used with Custom Structure Permalink

I'm using a "Custom Structure" permalink setting: http://mysite.com/%category%/%postname%/ However, when the post belongs to uncategorized, or to more than one category, this produces unwanted URL ...
0
votes
1answer
58 views

How to filter post using custom feild value in shortest and longest duration?

I am working on a video blog. On the front page I have a sort by option. You can try the option at the following link http://cricketclips.net/ Can't figure out how to make the shortest and longest ...
0
votes
0answers
34 views

Apply `the_content' filter to theme customisation live preview

I'm using 'transport' => 'postMessage' to update the text within the footer area during theme customisation live preview. My problem is that on my website, the corresponding theme setting ...
0
votes
0answers
80 views

How would I remove an inline googleAPI font script in the the parent theme header.php?

Is there any way to remove the function call to the googlefontapi font in the parent header.php file besides copying the parent header.php file to the child theme and then overriding it and delete the ...
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 ...
0
votes
2answers
212 views

Filter posts by tax (dropdown) and meta value

I'm having a page on which all my custom post types are displayed. I now need to add another to the existing ones: $args = array( 'post_type' => 'bkroadkill', 'post_status' => ...
0
votes
1answer
494 views

How to get the post excerpt using post object?

I'm trying to show post excerpt as in navigation. I'm trying this in plugin, does it make any sense? i don't know. I used $nex_obj = get_adjacent_post(false, '', true); for next post and it returns ...
0
votes
1answer
205 views

Let Users Filter Posts by Custom Fields

I'm using the Advanced Custom Fields plugin to add custom fields to my posts, but was wondering what is the best way to go about creating a filter box for the user to filter through posts. I've ...
0
votes
1answer
42 views

How to disable style filtering in post?

I need to put HTML code directly in post. It works, except for some css attributes : background-image position Every time a "editor" or "admin" user try to type those attributes in a style ...
1
vote
1answer
43 views

When does a function assigned to the content_filtered_edit_pre filter hook fire?

I added a function to the filter hook tag 'content_filtered_edit_pre', but it doesn't seem to fire no matter what I do. I am also aware of 'content_edit_pre', but I am curious as to when this filter ...
12
votes
2answers
572 views

How do I exclude plugins from getting automatically updated?

There is an opt-in filter that allows all plugins on my site to receive automatic updates: add_filter( 'auto_update_plugin', '__return_true' ); I like this feature, but I don't want all my plugins ...
0
votes
1answer
99 views

Debug output during filter execution doesn't work

I'm working on my first Wordpress plugin and am working on my first Custom Post Type. I'm looking to provide some debug output so I can see what kind of data I have to work with. I have the following ...
0
votes
1answer
30 views

Renaming wordpress login and get new password button

I am currently building custom wordpress admin login theme.Now I have an idea but not sure it is possible.I want to rename "Get New Password" to something "Get New". Is it also possible to rename "Log ...
0
votes
1answer
138 views

How to Highlight current category on category and single page template?

On Wp Forums, I found a code that shows categories with images and it works very well. But I couldn't figure out how to highlight current category on category.php and single.php Here is the code that ...
2
votes
1answer
86 views

Remove tags from the kses filter

I know one can modify the kses filter to add new allowed tags to it, but is there a way to remove some of them? I can't find how. I need to disallow DIV tags. Any ideas? Thanks
0
votes
1answer
31 views

Loading a sidebar on an Ajax call

I wanted to load a custom sidebar when doing an Ajax call, so I found the way with: add_filter( 'loop_start', 'my_sidebar_widget', 25 ); but it is showing the sidebar even in media admin panel, so ...
0
votes
1answer
57 views

What is the action or filter for adding information under the Permalink in Edit Post/Page?

I would like to add some HTML under the "Permalink:" in the Edit Post/Page page. Under here: So what is the action or filter?
0
votes
0answers
80 views

Removing image dimensions from `the_content`

I'm looking to remove image dimensions from the_post_thumbnail, as well as the_content. I've found the following code, but there's a slight issue: add_filter( 'post_thumbnail_html', ...
1
vote
1answer
144 views

Filter or action hook to insert content on admin pages before </body> tag

I am developing an administrator plugin and want to be able to write some HTML content just before the last body tag . This content will initially be hidden then displayed with javascript when a user ...
0
votes
1answer
170 views

the_excerpt() does not work with has_excerpt()?

I'm trying to shorten the excerpt but it does not work. It shows the full excerpt which I write in the post edit! I've added this to the functions.php function custom_excerpt_length( $length ) { ...
0
votes
2answers
59 views

Using filter in the widget causes fatal error

I'm adding a filter for a WordPress query in a widget. I'm adding as following: function filter_where( $where = '' ) { } add_filter( 'posts_where', 'filter_where' ); $query = new WP_Query( $args ); ...
0
votes
1answer
75 views

Is there a filter for get_post_custom()?

I know there's a filter get_post_content that I can hook into, but that only seems to work with get_post_meta, I need to filter individual values of get_post_custom() by checking if the metadata key ...
0
votes
0answers
72 views

Display Category only if there are posts of custom type

I need to do a small modification on WP site done by someone else. And my WP experience is close to zero. But I'm comfortable with PHP. Wordpress Version: 3.8 Plugins: ONLY Advanced Custom Fields ...
0
votes
1answer
358 views

Buddypress Group Activity Loop Filter activity type [closed]

I'm using Buddypress 1.8.1 When the group home page load I want to show only 'activity_update' and 'joined_group' activities in Activity Loop. Here is my Activity Loop code. It is standard loop ...
2
votes
1answer
678 views

Refine/Filter WP_Query Posts with jQuery or Ajax

I know this has been asked many many times, but I literally searched for an answer for more than 5 hours without finding anything that drives me in the right direction. What I'm trying to achieve is ...
0
votes
0answers
21 views

How to add parameters on add_filter()? [duplicate]

I have this example to customize the excerpt length: function custom_excerpt_length() { return 30; } add_filter( 'excerpt_length', 'custom_excerpt_length' , 10, 1 ); and works perfect. But I want ...
0
votes
0answers
72 views

Diffrent search templates for different post types

I have a site with diffrent post types. Two of them are the 'post' post type and the other one is 'charity', for both pages I have an index, the normal index.php and a diffrent page template for ...
0
votes
1answer
52 views

Is there a way to overwrite a filter used in canonical.php?

I am trying to replace the base functionality of the wp_signup_location to something custom. I realized that in canonical.php is where the filter is defined. Is there a way to redefine ...
0
votes
1answer
115 views

Proper after_setup_theme and wp_head cleanup

Im trying to clean up code in my theme a little bit, remove some of the code that is not used and basically do things the right way, to decrease load time etc. Currently I have this code: ...
2
votes
2answers
68 views

Please help me through this example with a filter to understand how they work

I am looking at this generate password function: function wp_generate_password( $length = 12, $special_chars = true, $extra_special_chars = false ) { $chars = ...
0
votes
0answers
111 views

Query Posts Via WordPress URL

I wanted to learn more about querying post types and their custom fields in WordPress. I've got two questions... I've followed this tutorial on Advanced Custom Fields and am trying to understand what ...
0
votes
0answers
33 views

Custom field in title

I'm trying to change the posts with no titles to 'custom field' + 'mystring'. So far I got this code. add_filter( 'the_title', 'ta_modified_post_title'); function ...
0
votes
1answer
183 views

How to filter bbPress replies (content)?

I wanted to know, how to filter bbPress replies ? ( i mean as the typical post's the_content filter..) this one doesnt work: add_filter('the_content','custommm_functiooonn'); function ...
0
votes
1answer
60 views

How to Use the Filter “sidebar_login_widget_form_args”

I need to rename some of the labels on the Sidebar Login form using the sidebar_login_widget_form_args" filter; I have been trying few days to do this without any success. I would very much ...
-1
votes
1answer
49 views

AJAX: Wordpress filters inside $html do not work as intended

I am sending HTML content through some AJAX magic and while everything is working as I wish, the output gives something along those lines in the page: "http://permalink.comtitle" It's as if all the ...
1
vote
2answers
285 views

Hook for post permalink update

I would like to know what hook should I used when the permalink/url of a post is modified. My goal is to get the old permalink and new permalink so I can used it for my plugin. Thanks. [EDIT] Just ...
0
votes
1answer
45 views

Is this hook really deprecated? ( manage_{$taxonomy}_custom_column )

I've been adding some data to the columns of two taxonomies in a theme I'm working on. I've hit something that's got me confused though. I'm using this hook manage_{$taxonomy}_custom_column but the ...
0
votes
2answers
1k views

Reposition Woocommerce Message

I'm trying to reposition the messages in my Woocommerce theme. For example the successfully added to cart message. They appear to automatically be placed at the very top of where the woocommerce ...
0
votes
2answers
275 views

Help debugging PHP filter for wordpress [closed]

I have a PHP filter for wordpress/gravityforms, that just recently stopped working and I can't figure out why. Can anyone help me? Here's the code: add_filter('gform_pre_submission_2', ...
0
votes
4answers
3k views

Programmatically Add Font-Awesome Icons to Category Widget

I use the Categories widget on my sidebar(s) and I would like to display a Font Awesome icon next to each category listed in the widget. The icon would be the same for all categories, for now, but I ...
0
votes
1answer
47 views

Display taxonomy with a maximum number of letters

I'm looking for a function which displays a post's taxonomy with a maximum number of letters. I've achieved with title (How to limit the max number of characteres in the title that are displayed), but ...