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

learn more… | top users | synonyms (5)

0
votes
1answer
35 views

Get terms of the posts with one query

I need to get the terms for 2.000 posts. How can I do this without making 2000 queries? Is it possible to get terms of the post in the post_object with a filter or something similar? ...
0
votes
0answers
17 views

After Image is Uploaded Set Custom Thumb size

This is the function for making a custom thumb size. BUT this needs to be executed after the image is uploaded. How do i do that? What is the "image path" after i upload the image? Thank you. ...
0
votes
1answer
21 views

String Replace Caching & Chance of Collisions

I am noticing that for various reasons I am using lots of string replacements in Wordpress and I am concerned about this impact on performance once it goes live. I am not advanced in caching but it ...
0
votes
1answer
29 views

Change shortcode output (filter?)

I'm new to filters and actions and I'm starting to see how useful they are. However I do need a bit of help with the following problem. I'd like to remove the html code from this <?php if ( ...
0
votes
1answer
18 views

How to know what filter to use and how to use it?

How can I know what filter I can use to change anything and what my function have to return ? For exemple, sometimes I have to add a or a to a post title. It works (WP doesn't sanitize html tag ...
1
vote
1answer
23 views

Plugin options, presets and filters : can you help me improve my workflow?

I'm building a plugin and I have hard time handling options on it. I already did try several ways but I think i'm stuck on a structural problem here. I would like to have your input on all of this ...
0
votes
1answer
22 views

Feed, RSS not able to clear the cache and cannot change the limit of cache life time

The WordPress Feed system is EXTREMELY complex for no reason. I have been going around and around and around in circles. I am using: function do_not_cache_feeds(&$feed) { ...
1
vote
1answer
61 views

How to set a filter by category within a customised page

I'm still fairly new to the wonderful world of WordPress development and was hoping for help with a question.. I've got a simple page template which extracts all posts under a certain category and ...
0
votes
1answer
51 views

Modifying date filter on admin page for custom post type to link to custom field

Apologies if a similar question has already been asked, but I can't seem to find the exact functionality I am looking for. Basically I have a custom post type (sermons) which has 'recorded_date' as ...
0
votes
0answers
29 views

How to edit the response header of a post/page?

I am rendering a post/page differently. Instead of displaying an HTML document, I am making the page render a javascript code. The default content type of a wordpress post/page is text/html, is there ...
0
votes
1answer
26 views

Remove posts_orderby filter then add it back in

I'm using remove_all_filters('posts_orderby'); to remove the order for a query. For a query further down the page I need the filter back. How do I add it back in?
0
votes
1answer
54 views

Filter wp_dropdown_categories Per Post Type

I'm using wp_dropdown_categories to add a categories filter to the media library. It works fine, except it displays all the categories that are assigned to posts, but I would like it to only display ...
0
votes
1answer
45 views

WP Dashboard -> Posts-> Filter by Category -> Form Method Change : Which Hook

We have a contemporary 4.2.2 WP install running with a handful of various plugins. We have been facing an issue where when a provisioned user is in the "POSTS" dashboard view, the ability to filter ...
0
votes
1answer
44 views

How do I override the_excerpt so that it will display full content?

I am creating a plugin. Many themes display excerpt such as when is_search() is 1. I want WordPress to display full content no matter what. How would I do so? Should I use add_filter ...
0
votes
0answers
71 views

image_send_to_editor filter - Unwanted paragraphs and line breaks

I'm using image_send_to_editor to filter the output the images that are inserted to my posts. The filter works perfect except for when I'm updating/saving the post. A new paragraph with a line break ...
0
votes
1answer
24 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
53 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
37 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 ...
2
votes
2answers
40 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
36 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
17 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
33 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
9 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
61 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 ...
3
votes
1answer
62 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
41 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
41 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
44 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
36 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
17 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
70 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
42 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
70 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
275 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
16 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
29 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
29 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
67 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
19 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
29 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 ...
26
votes
3answers
4k 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
28 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
45 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
43 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
21 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
42 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
68 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
28 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
53 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
43 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 ...