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

what is the point of telling add_filter how many parameters you want passed to the function?

In wp-includes/plugin.php (apply_filters) there's this: foreach( (array) current($wp_filter[$tag]) as $the_ ) if ( !is_null($the_['function']) ){ $args[1] = $value; ...
1
vote
0answers
18 views

Slow WP_Query with 'OR' on meta_query

Essentially, I'm trying to query using a filter for the args being fed into WP_Query() like so: public function filter_wp_query( $args, $template_slug ) { $args['post_type'] = ...
0
votes
0answers
11 views

add_filter post_gallery and do_shortcode

I'm attempting to swap out short codes on the fly but having an issue that I'm hoping someone can help with. Basically I've added a "Gallery Type" option to the wp.media library and am using the ...
1
vote
2answers
31 views

What effect does the_content filter have on performance?

This is general question but lets say I have a function and on a specific page I want to display a table. The function only applies to one page on my site but every post/page will run this function ...
0
votes
2answers
32 views

Add filter unless it is being called under specific function

I want to add a filter ... but not if it that filter is called by a specific function. Here's a simplified example: <?php add_filter( 'get_the_excerpt', 'wp_trim_excerpt' ); function ...
0
votes
1answer
9 views

posts_results filter function memory errors

My posts_results filter is causing memory errors and I can't figure out why. Here's the full snippet: /*-----------------------------------------------------------------------------------*/ /* ...
0
votes
1answer
19 views

post_results filter confused by pagination in sidebar and main section

I have a post_results filter that I want to use to manipulate the results returned from a the query. Let's say that it's supposed to put stars around the first post on the first page, second post on ...
0
votes
0answers
6 views

Filtering Index By Categories

Goal: At the top of my index page, I would like to have a list of the categories of posts - for example: "All", "Apples", "Oranges", "Bananas", so that when I click on a category (Oranges) then the ...
0
votes
1answer
17 views

pre_get_posts to hide everywhere posts from “Archive” category

I want to hide some posts from feeds, searches and nearly everything, apart from URL to this post. To have so called archive. Private post is also not an option because unlogged users with URL should ...
2
votes
1answer
26 views

How can I display image metadata?

I'm trying to add a filter to the_content that will find all images in the post and append the custom attachment metadata credit to it. Here's the functions I've have: Adds the Credit field to ...
0
votes
1answer
18 views

How to filter sql only for a specific post type

I have been trying to join a custom table with a regular wordpress query, but only under a specific condition (a specific post type). I have a single-event.php template that runs the main query, and ...
0
votes
1answer
28 views

Get results from the main wp_query

I would like to alter the main wp_query and then email the results as PDF or HTML email. I have managed to filter wp_query using custom filters and some code similar to this inside my plugins ...
0
votes
2answers
27 views

Shorten the title length

So I'm using this filter in order to shorten the title: function the_titlesmall($before = '', $after = '', $echo = true, $length = false) { $title = get_the_title(); if ( $length && ...
0
votes
1answer
10 views

Custom post type with Filter and Page Nav

A custom post type custom also have special custom fields people and location I am trying to get this in the listing archive page with a filter on people location year (which is the post date) to ...
0
votes
2answers
12 views

How do I add a class to all sidebars to let a Google Custom Search Engine know not to index the content?

I've replaced the WP search on my site with a Google CSE. Google has a nice feature that lets you specify that certain areas of the page should not be indexable, by adding a "nocontent" class to those ...
0
votes
1answer
20 views

Modifying WP_Title For Custom Post Type

Trying to modify the output of the WP_Title through a custom post type with a filter. I've had no issues doing it to the_title but I assume as the wp_title function is called through the header it's ...
0
votes
1answer
26 views

Make the 'all' filter default instead of 'mine' in a custom post type

I reckon this one is quick and easy... I think I'm just missing something very obvious. My inquiry is nearly identical to this stackoverflow post. For non-admin users, the default filter for posts ...
1
vote
1answer
14 views

Dropdown category filter

Ive an array set up to filter through various categories, currently it is only displaying 10 a maximum of ten posts instead of all of them. Where have i gone wrong? <div class="select-search"> ...
0
votes
2answers
116 views

Add Fields with Sub-Fields to WP Job Manager

I have been working on a custom add-on for WP Job Manager where I modify, via filters, the content displayed. I've used many of the tutorials on www.wpjobmanager.com/documentation, but I'm stuck on ...
0
votes
0answers
15 views

How do I remove_action for the function from included file

I'm building a theme and trying to reuse code from another file in my header.php by doing this: include_once( get_stylesheet_directory() . '/root-theme/header.php' ); This include works fine. But ...
0
votes
1answer
21 views

Problem with Class, Filters and Callbacks

according to this Callback example if I'm referencing a method inside a class, I should use add_filter by specifying an array with 2 elements, first the object then the method. Here is my code: ...
0
votes
1answer
15 views

Jetpack Comments Change Placeholder Text

Is there a hook or template file where I can change the placeholder text on the #comment textarea w/in the comment form? Jetpack loads the form via an iFrame which prevents changing the placeholder ...
0
votes
2answers
34 views

Firebug and Chrome rendering two body tags

I have a curly problem I've been working on for some time. At first it appears as if the get_body_class() function was broken but after I removed it from the template the issue persists. <html ...
0
votes
1answer
15 views

shortcode which is introduced into entry the blog, and appears in side bar

I have the following shortcode plugin, it works perfectly, nothing more I want to put you in the blog and appear in the sidebar, how I can accomplish this? I want not put a widget in the sidebar, ...
0
votes
0answers
21 views

When to hook into edit profile action?

I have the following function which combines the values of a few user profile fields and saves them as a new user_meta called COMBINED_WORKSHOPS. The function works, but I don't know when/where to ...
13
votes
2answers
1k views

Disable emojicons introduced with WP 4.2

So WP 4.2 introduced emojis (smileys) that basically adds JS and other junk all over your pages. Something some people may find shocking. How does one completely erase all instances of this?
0
votes
0answers
15 views

Show child theme for users on specific IP

I have some users coming in from a fixed IP range on a very slow connection (256kbps) so want to server them a child theme that has a lot of the bandwidth intensive features removed. For ease of ...
1
vote
0answers
19 views

Custom filter function not working with Custom post type

I have custom post type "soto_property". I have made a custom filter to filter post listing according to used meta data named "operations". Here is my code- <?php add_filter( 'parse_query', ...
2
votes
0answers
37 views

How to make a widget expand wider than the column width when editing its settings in the admin

The WordPress Text widget expands horizontally beyond the margin of the sidebar when added to a sidebar and opened in the admin and I am trying to apply that function to a widget. I see inline css is ...
0
votes
1answer
14 views

How to add filter for wordpress plugin?

I have a really newbie question, but I'm really new to WordPress development. In the plugin that I'm using is using this filter. if ( true === apply_filters( 'some_custom_filter', false ) ) { ...
0
votes
1answer
19 views

How to replace all images in all posts and pages with a different size?

I'm about to reboot an old blog of mine and therefor I'm creating a new theme from scratch. Before I'd align pictures left and right, because it seemed good. But now I want to make it much cleaner and ...
6
votes
1answer
58 views

How to add taxonomy filter on the query fly?

I try to add tax query on pre_get_posts hook using following code : // Add custom posts to main query (archive and home) add_action( 'pre_get_posts', 'add_post_types_to_query' ); function ...
0
votes
0answers
20 views

How to get all the predefined do_action() calls from an active theme

To hook my plugin content into anywhere, suppose I offered the theme developers to create their own hooks with a prefix (pre_) anywhere in their theme - the rest of the hook is unknown to me. So what ...
0
votes
0answers
22 views

Avoid changing menu query with suppress_filters => false

I recently had to change qTranslate for qTranslate X since the former is not being updated. This broke my menu and after searching I found it was because qTranslate X sets suppress_filters to false. ...
1
vote
1answer
28 views

Get posts with at least one category in common with current post?

In single.php : I want to get all posts with at least one category in common with the current post. I tried reading through the wordpress codex documentation but I found it rather confusing (I'm ...
0
votes
1answer
10 views

Display child pages on homepage template

I thought this would be a simple case of following the Codex but apparently not. I'm trying to display child pages of a particular page on my homepage using a custom made template. So far I've managed ...
0
votes
1answer
62 views

Woocommerce Price Text

I'm trying to show after the price of my product, whether the price is 'per person' or 'per group'. I've created a custom field for both, so for example, if custom field 'price_per_person' is ticked, ...
0
votes
1answer
33 views

what is do_action(); in wordpress? [duplicate]

Sorry for making duplicate Topic but it is very important to me because i don't understand this topic by looking other related topics. Actually i am in process to build a WordPress theme and i am ...
0
votes
1answer
34 views

How do i get all author posts on custom post type list

I am trying to filter a custom post type by some custom fields value and if the posts are by author, query for 2 custom field works but author posts doesn't work. Thanks! add_filter( 'parse_query', ...
0
votes
1answer
47 views

add_filter does not work as expected

I have a wordpress plugin where i included this (with some changes) $fep_files = array( 'first' => 'first.php', 'second' => 'second.php' ); $fep_files = apply_filters('include_files', ...
0
votes
0answers
16 views

How to filter displayed posts like what we can see on products page

I wanna know if there is a way to filter displaying post on clicking on menu or a link. I know that there is some ways for admin post list, but i want it for front pages. I think we can do that by ...
0
votes
1answer
43 views

remove_action not removing add_action from constructor

I am trying to replace a message from a function that got hooked in a constructor from a class from woocommerce. This is what I tried to remove the message: What I tried. function remove_actions() ...
0
votes
0answers
16 views

Click on link to filter displayed posts like what we can see on products page

**I wanna know if there is a way to filter displaying post on clicking on menu or a link. I know that there is some ways for admin post list, but i want it for front pages. I think we can do that ...
0
votes
1answer
23 views

Custom filters inside a specific category?

I have different categories that require different filters For example a 'training' can be about a specific bodypart, by a specific athlete,.. What I want is something like this: But different ...
0
votes
1answer
57 views

Filter keywords from search query

I have search over the google, somewhere out there and here(http://wordpress.stackexchange.com). But, i can't seem to get the solution i was looking for. I would like to ask that, is there any ...
0
votes
0answers
19 views

add_filter('body_class') running from widget even when widget is not loaded on page/post

This should be adding a function to init() to check if the widget is active widget on the front end on a page/post - but even when the widget is not loaded on a page/post, .Widget_FilterProject is ...
0
votes
0answers
14 views

Filter displaying posts

I wanna know if there is a way to filter displaying post on clicking on menu or a link. I know that there is some ways for admin post list, but i want it for front pages. I think we can do that by ...
0
votes
0answers
26 views

Adding 'query_vars' filter redirects to the latest posts page

On our main page we tried to use an additional query parameter to keep in session and use later. Instead of browsing www.example.com/mywp, the user is now browsing www.example.com/mywp?param=value and ...
0
votes
0answers
8 views

Why WordPress attachments LINK TO settings are not working?

Using this code below, I added some on-hover share icons for all images of the content. But, now these images are not getting any "Link To" setting from authors. I don't know what is the problem. Can ...
0
votes
1answer
28 views

Custom display for homepage, tag and author pages

I need to have pages where the first post on the page has a special format. I've figured out how to modify loop-home.php to get the result I want outputted on the homepage. I want to have the same ...