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

learn more… | top users | synonyms (5)

0
votes
1answer
14 views

Filtering the_content, but still need to display the unfiltered content inside filter

I'm working on a plugin that creates and displays Custom Post Types. I'm using ACF for additional fields. Problem comes when I need to add the actual content into the filter. There's a slideshow in ...
0
votes
0answers
9 views

How might one programmatically set the link for all images in all posts?

Every post on my Wordpress site contains at least one image (in the content, not as an attachment). Each post also contains a custom field with a URL. I'd like to programmatically modify all posts ...
2
votes
3answers
2k views

Add class to menu items of one specific menu (nav_menu_css_class)

This code adds an extra class to all my menu items: add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 2); function special_nav_class($classes, $item){ $classes[] = 'btn'; return ...
1
vote
1answer
430 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 ...
0
votes
2answers
34 views

Avoid user registrations with specific email provider

I have been under a spam attack, someone is creating a lot of users daily, it could be a bot, all those users have the same email provider, is there any way in which I can avoid that anyone creates a ...
0
votes
1answer
35 views

Woocommerce filter cart and category specific quantity [on hold]

So basically, I'm trying to filter my cart. I would like the message below displayed if products from the "cuvees" category are at the number of 4,5,7,8,9,10,11,13,14,15,16,17,19,21 in the cart. So ...
0
votes
0answers
8 views

WooCommerce How to add an additional column to expoert in CVS [on hold]

I am using a plug in to add an extra column to fill in for our customers to enter, which is "Shipping phone number". But when I export our orders using WooCommerce official extension "Order/Customer ...
0
votes
0answers
20 views

Why is WordPress stripping anchor links from mneu item URLs?

I have a taxonomy page that lists all the sub-categories. I want to link directly to the sub-category position of that page from the main navigation menu. I set up a menu with the main category ...
0
votes
1answer
232 views

custom gallery filter with image caption as link title?

I use a custom gallery function to alter the normal Wordpress markup. Usually it's fine but I can't quite figure out how to add the image caption as a TITLE attribute on the thumbnail link. (The ...
0
votes
2answers
293 views

How to Wrote Simple Calculations by Using Custom Fields in Loop?

I am building a website with whole bunch of custom fields and need to implement several custom fields that will auto calculate values by using values from other custom fields. All files which I need ...
2
votes
2answers
1k views

How to use filter hook 'post_updated_messages' in coherence with action hook 'save_post'

I am trying to send out e-mail, SMS and IM notifications to group members of this WordPress website, whenever a WordPress page in their user group has been published/updated. I figured using the ...
0
votes
1answer
40 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
1answer
21 views

Remove comments validation (remove filter?)

How i can remove wordpress comments content validation, I do not want to or examined the earlier there was no such comments. I see for: ...
0
votes
2answers
2k views

How to append new form elements in “Add New” form of Users in Wordpress admin panel?

I'm developing a WordPress plugin and I want to append some extra form fields in add new form of Users section inside admin panel without editing core files. Can somebody help me in achieving this.
0
votes
1answer
25 views

Sorting on Taxonomy in archive page

<?php get_header(); ?> <?php //Define the function function customize_customtaxonomy_archive_display ( $query ) { if (($query->is_main_query()) && (is_tax('employee'))) ...
0
votes
0answers
15 views

WooCommerce - filter products in backend [closed]

I need to filter the product-query for the complete shop (categories, product detail, search results). Dozens of plugins are available to give the user a sort-option, but what I need is filtering and ...
3
votes
3answers
104 views

Filter for “get_post_type_archive_link()”

I tried to find filters or a hook to modify link returned by this function get_post_type_archive_link() I have gone through most of the documentation. I'm not sure it's not there or I'm not able to ...
0
votes
0answers
15 views

Get menu item data from menu item ID

I want to filter the_title when I output a custom menu (of internal pages) using wp_nav_menu(). My pages have a custom field called 'short_title', and I want to use these values in my rendered menus ...
0
votes
0answers
17 views

Using Filters To Change Page Title

Been trying to wrap my head around using filters to change titles. I've been using a third party plugin to incorporate real estate listings. Having contacted the developer on asking if I could ...
1
vote
2answers
423 views

Replace audio links with jplayer using the_content filter

I am attempting to use : add_filter( 'the_content', 'filter_function_name' ); To find all of the anchor tags in my post which link to a .mp3 file, and then replace them with a jplayer instance that ...
0
votes
1answer
300 views

Search a title word through query_posts (not the exact match)

We're working on a database with personal data from different sportsmen such as name, height, weight, etc. We've managed to build a detailed filter through query_posts. Every filter field is working ...
0
votes
1answer
27 views

“Maximum function nesting level of '100' reached” after adding a new filter

I am trying to filter my post title for a specific page and when a form is submitted on that page , for this I am trying to filter my title . Here is the code function filter_title_after() { ...
0
votes
1answer
14 views

Must filter functions receive all arguments passed to them?

I'm writing a filter function to redirect logins: function my_filter_func( $redirect_to, $requested_redirect_to, $user) { // My code. } add_filter( 'login_redirect', 'my_filter_func', 10, 3 ); ...
2
votes
2answers
747 views

How to hook a filter to catch get_post_meta when alternate a custom field output?

How to hook a filter to catch get_post_meta when alternate a custom field output? I have fill a custom field(meta data) in a post, just like this: <!--:de-->Nominale ...
0
votes
0answers
50 views

Display the combined WordPress and Facebook comment count in Genesis child theme

I have a Genesis child theme in which I display both WordPress and Facebook comments. I would like to display the combined WordPress and Facebook comment count in the comments link. I found the ...
0
votes
1answer
47 views

Should I use add_action('publish_post or add_filter('publish_post?

I am trying to trigger an extra function as soon as a certain custom post type is published function insert_table_products($post_id, $post) { if ($post->post_type == 'custom-products') { ...
0
votes
0answers
12 views

add_action - $function_to_add first argument defaults overwritten

I have an issue with the following code, $function_to_add first argument defaults are overwritten with an empty string "" and it cause an error: Warning: join(): Invalid arguments passed The second ...
1
vote
2answers
20 views

Query posts if meta key starts with

I need to find posts with a meta key that starts with the current year + the current month (i.e. 201502), but the actual value could also contain any day within that month (i.e. 20150214). The ...
1
vote
1answer
324 views

Walker_Nav_Menu doesn't work in wp_page_menu_args filter

I need to hide certain nav items from the menu (based on the password protection functionality) and I'm having trouble getting my custom Walker to work. In fact, I can't even get the standard ...
0
votes
1answer
281 views

function triggered by “manage_users_custom_column” filter not working

I am trying to add a custom column un users.php but it stays empty. I have successfully added a column to the users admin page with this code in my theme's functions.php file: function ...
1
vote
1answer
1k 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
0answers
18 views

Remove action added from class

This has been asked before and I know how to do this but im having trouble removing a specific action added by the easy columns plugin. The action is added similar to below: class EasyColumns { ...
0
votes
1answer
18 views

Add filter to Orderby Parameter using Array

Using WP-Query, I'm setting the Orderby parameter using an array: $events_args = array( 'post_status' => 'publish', 'post_type' => 'events', 'meta_key' => 'start_time', ...
0
votes
1answer
49 views

How can I add a column in the wp_list_table of the admin area?

So my question is pretty much what you see in the picture. In my custom post type of "Products" how can I add an extra column like SEO Yoast did to my main table which is called WP_List_Table. I ...
0
votes
3answers
18 views

Apply wordpress filter checking category

I am trying to apply wordpress filter hook get_the_expert. My intention is to apply filter only when the category slug is "MY-CATEGORY-SLUG". How can I check the category slug inside the filter hook ...
0
votes
1answer
17 views

WP action/filter to modify title before header output and article output?

I'm trying to split test two versions of a posts title using a custom plugin. So far I haven't found the right filter or action to hook into to modify the title on the meta tag level before the page ...
0
votes
0answers
9 views

add_filter and tag of footer post

I need to tag of post footer in add_filter() function, For example : add_filter( 'the_content', 'vmp_add_voting_links' ); I have the above code in a plugin and i want to replace the_content tag ...
1
vote
2answers
47 views

How can filters be run when they are never applied?

I'm trying to track down why menu switching by language in the polylang filter is not working correctly. I'm looking at the function nav_menu_locations which is added as a filter as such: ...
0
votes
2answers
472 views

Unregister widget from Child-Theme

I like to use a child-theme. The parent functions.php function starkers_widgets_init() { // Area 1, located at the top of the sidebar. register_sidebar( array( 'name' => __( 'Primary Widget ...
0
votes
1answer
24 views

Sort search with posts_orderby

I need to sort my search results by custom post type. the problem: the order is custom. I do have 5 different post types and i got the order like so: artist artwork page post publication I'd like ...
6
votes
4answers
756 views

Apply class to every paragraph that holds image?

When adding an image to a page or post, Wordpress is automatically adding a paragraph tag <p> as parent holding the image. Like so: <p><img src="my-image.jpg" alt=""></p> ...
3
votes
3answers
1k views

What filters are applied to the_content function?

How does WordPress convert raw data from the database to a readable format in the_content function? I've noticed that it applies the_content filter, but what does the_content filter do?
0
votes
2answers
478 views

How to apply the “retrieve_password_message” filter?

I would like to change the body of the password reset email that WP sends out with something more friendly. I am trying to use the "retrieve_password_message" filter but I am messing it up. Can ...
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 ...
0
votes
0answers
29 views

How to filter a a variable in a plugin's function?

I am using a third party plugin in my project , in that plugin there is a function like this public static function get_form($EM_Event = false, $custom_form_id = false){ //special lookup for ...
0
votes
0answers
34 views

Wordpress Social Login > Post to a users Facebook wall

I'm trying to post to a currently logged in Facebook user's wall/timeline. I found this on the plugin authors github documentation: ...
0
votes
1answer
26 views

Exclude Empty Child Categories in Menu

I am working in WooCommerce and trying to filter out the empty sub categories. I found this code, which filters out everything "empty"...including my Home page link, About us link, etc. function ...
1
vote
1answer
110 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, ...
0
votes
1answer
890 views

Filter categories using tags

I have a website with the following categories: Videos Pictures Stories And I have a lot of tags like: Funny, Awesome, Mind Blowing, Crazy, etc. Is there a way I could filter lets say: Videos ...
1
vote
1answer
727 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 ...