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

learn more… | top users | synonyms (5)

0
votes
0answers
15 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
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
0answers
10 views

WooCommerce - filter products in backend [on hold]

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 ...
2
votes
3answers
86 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
1answer
23 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
12 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
15 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 ...
0
votes
1answer
24 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
12 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 ); ...
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 ...
0
votes
0answers
33 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 ...
1
vote
2answers
18 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 ...
0
votes
1answer
45 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
17 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
3answers
16 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
47 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
1answer
14 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
8 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
41 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
1answer
20 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 ...
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
33 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
24 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
12 views

Archive filter disappears on no results?

I have been working through this example: http://www.advancedcustomfields.com/resources/creating-wp-archive-custom-field-filter/ That a colleague of mine found for creating a simple checkbox-based ...
0
votes
0answers
14 views

The title of an attachment is not working

I use this function to assign the title of every page: function my_title() { switch ( true ) { // [...] case (is_attachment()): wp_title(''); // This doesn't work ...
0
votes
0answers
11 views

How do can I pass data retrieved from a filter to template files?

I wrote this class to display only the current top level menu item's children: class deseng_navSplit { var $sorted_menu_items; var $args; function __construct($x, $y) { ...
1
vote
1answer
65 views

Use 'parse_query' filter to show posts that from multiple criteria

I am trying to filter the Posts page in the WordPress admin to show posts that meet the criteria for "A" -or- the criteria for "B". I've scoured documentation and can't find a good way to do this. ...
0
votes
0answers
10 views

Is this the proper way of switching the “Edit My Profile” link with my BuddyPress “Extended Profile” link?

I am using the Multisite feature enabled. I have a main site and a community site. On the main site the 'Edit My Profile' links is pointing to this link: ...
1
vote
0answers
50 views

Run oembed separately outside the_content()

I have this structure for my content.php : <div class="featured"> <!--featured image here--> </div> <h1 class="entry-title">Post Title</h1> <div ...
0
votes
1answer
23 views

Search pre_get_posts filter which can handle multiple post types and categories?

I have a Search which allows users to search multiple custom post types (CPT). That works fine. BUT I would like the query to exclude specific tags from each of the CPTs. Eg. Include ( (Posts ...
0
votes
0answers
44 views

Converting a checkbox filter for custom fields to a dropdown

I've been scratching my head trying to figure this out for awhile now and was wondering if someone could provide some help. My PHP knowledge isn't the best so I'm working with what I have and it ...
0
votes
1answer
35 views

paginate_links() Change the order of links

While using paginate_links() function of WordPress, i need to change the order in which it echo's its output. For example, by default it will output pagination links in this format: Default Output: ...
-1
votes
0answers
23 views

Is there a way to remove the wrapping anchor tag when outputting the_author filter?

I am trying to implement a custom plugin that will allow customized output of a post's author (including name, institution, and description). It outputs rich HTML, and the problem I am having is not ...
0
votes
0answers
11 views

Filtered $locale isn't applied on templates language lines

I change the global $locale by the following code in my functions.php function change_locale_on_admin ($locale) { if(is_admin()) { $locale='en_US'; } return $locale; } ...
0
votes
0answers
38 views

Conditionally Use image_resize_dimensions()

I used add_image_size() and image_resize_dimensions() to upscale and crop images in WordPress. It is working as expected except on the Edit Media page. Generally on this page you would see your full ...
0
votes
0answers
13 views

custom post types not appearing in Search multiple post types

I have a Search page where users can select to search for multiple post types: posts, pages, docs, newsletter. What is driving me nuts is that: a) Users can select posts/pages OR docs OR ...
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
24 views

Problem adding class to body_class

I am trying to add additional classes to <body> based on certain conditions, so I have this code in my functions.php file of the theme : add_filter( 'body_class', 'custom_body_class' ); ...
0
votes
1answer
11 views

How to query if meta_key does exist or not?

Good day, I am trying to negate my query to show all instead except for a post with a custom field of file gallery. 'meta_query' => array( array('key' => ...
0
votes
1answer
23 views

How To Get User Data in Callback Function for pre_user_nicename?

Whenever I update a user profile in the dashboard, the user nice-name gets changed in the database: Every time, a "-2" is added. I tried to reset the nicename (based loosely on this thread) by ...
0
votes
3answers
65 views

How to use return in my custom function instead of echo

I'm creating a function in functions.php with a custom hook, and from what I've read somewhere, it's good practice to return instead of use echo in a WordPress function? Correct me if I'm wrong. ...
0
votes
0answers
28 views

Rewrite Rules with custom taxonomies not changing

I've been messing around with wordpress custom taxonomies recently in conjunction with advanced search queries and I'm trying to make search urls look prettier by using rewrite rules, these taxonomies ...
2
votes
2answers
89 views

Filter translations (gettext strings) on specific admin pages

I'm trying to do a string replacement using gettext filter (source): function theme_change_comments_label( $translated_text, $untranslated_text, $domain ) { if( stripos( $untranslated_text, ...
2
votes
1answer
73 views

Always use <figure> for post images

The default behavior when it comes to full-width images in posts is this: If you insert an image alone, this HTML structure is produced: <p><img/></p> If you insert an image with a ...
0
votes
0answers
20 views

posts_clauses : Filtering Posts by multiple meta posts issue

Im trying to write function to filter posts by country and language, but as I see here posts are not filtered and I cant detect where is the problem. This is my code inserted in beginning of my ...
0
votes
0answers
14 views

Setup lazyload on post images using get_image_tag

According to jQuery.lazyload any images I'd like to "lazyload" need to have the src attribute replaced with data-original. I'm assuming I can do this using WP's get_image_tag filter, but I'm stuck on ...
1
vote
1answer
142 views

apply_filters('the_content', $content) vs do_shortcode($content)

Lets say I have a theme option or custom postmeta text area. Now I want to execute multiple shortcodes, general texts, images etc. What will be best practice and why? Option 1: $content = //my text ...
0
votes
0answers
67 views

add current-menu-item to multiple custom post types

I have two custom post types, and I have trouble adding the current-menu-item to both. In my functions.php I have following code: function additional_active_item_classes($classes = array(), ...
0
votes
0answers
25 views

do_action filter function from add_action array

I am looking at the following setup: -- Combing multiple functions into single action -- add_action( 'single_post_meta_start', array( $this, 'the_title' ), 10 ); add_action( ...
0
votes
0answers
8 views

Widget is breaking on filter function

I have created a widget which displays posts based on Display Posts shortcode. All works fine till I have added filter to public function widget() to output titles only (and need to be executed only ...