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

learn more… | top users | synonyms (5)

0
votes
1answer
6 views

Add filter menu to admin list of posts (of custom type) to filter posts by custom field values

Also the same question as here: Add filter menu to admin list of posts (of custom type) to filter posts by custom field values But need to search by selecting meta_key and searching by meta_value but ...
0
votes
1answer
17 views

preview_post_link for Custom Post Types

I've got a custom post type, and I'd like to be able to change the preview link but from what I can tell, the hook for preview_post_link only affects the default post type. Any guidance? Here's what ...
0
votes
0answers
17 views

How to modify core when there is no hook?

I want to add a custom HTML5 attribute to the <form> element in the comments form. Since the form field itself is generated by comment_form(), and there is no hook to edit within the opening ...
0
votes
1answer
18 views

WooCommerce comments_template Filter Not Firing

I have a template file that is being called via wp_ajax that returns data from a specific WooCommerce product. In the "tabs" section of the template file every tab is working fine: Description - ...
2
votes
2answers
22 views

Change upload directory on custom plugin page

I am trying to change the path to my uploads directory when on this one specific page in my custom plugin. The page is a standard php page and not any specific type of post type page. I have found ...
0
votes
0answers
12 views

Prevent WP from wrapping html in caption shortcode after 'image_send_editor' filter is applied

In my functions.php I have cooked up some functions to filter the attachment output code, when an attachment is sent to the editor. function filter_image_send_to_editor($html, $id, $caption, ...
-1
votes
1answer
18 views

WordPress plugin add_filter returning a link does not work. What is the correct way?

function ls_de_options($content) { return '<h3><a href="www.google.com">Hello World</a></h3>'.$content; } add_filter( 'the_content', 'ls_de_options' ); ...
0
votes
1answer
21 views

Media upload default title from file name

I'm on a roll today with the questions. Is this easy? Again, I can't seem to find the right filter (nor previous question with a suitable answer). So if you download an image say, from GettyImages, ...
3
votes
1answer
26 views

How to add icons to post listing (edit.php) in admin

Is there a filter or something to add these kind of icons based categories and what not to all posts? I can't seem to find one. I tried the_title but ofc that gets sanitized and just displays the ...
-1
votes
0answers
13 views

Anyone know how to create comparison table with filtering? [closed]

The thing that I want to do is something like this: Comparing product features The visitor want to compare two product at the one time: iPhone 4s Vs iPhone 5s --> will show up 2 table side by side ...
2
votes
1answer
43 views

Changing Posts Per Page and offset with pre_get_posts

I have a filter using pre_get_posts to change the number of posts per page from 4 on the news landing page to 8 on all other pages (page 2, 3, etc). However I don't seem to have got the offset ...
1
vote
1answer
21 views

Are there actions or filters I can use for Ajax calls?

I'm interested in writing a caching function for Ajax calls. If a third party plugin does their thing, calls wp_ajax_whatever, how do I pick that off? If a person does slideshow updates with a ...
-1
votes
1answer
19 views

add_filter to 'woocommerce_before_main_content'

I added a filter in functions.php and change priority very high and low to 1 but every time the parameter is an empty string""; add_filter( 'woocommerce_before_main_content','wc_start_layout'); ...
1
vote
1answer
46 views

Sorting and limitation with pre_get_posts

This is my third question regarding WP queries and pre_get_posts (sorry about that) but I cant give up one step before the full success :) So the story - my query is limiting front page posts to ...
0
votes
0answers
18 views

Portfolio filtering menus script in Wordpress and JQuery

This is the page: scharc.com/en/projects Let's say I select the Department, then the Field of Expertise and finally a Location, for example. Right now deselecting the Location doesn't free any ...
0
votes
1answer
21 views

How to filter content in Dashboard?

I want to modify the post content, before it is shown in dashboard "EDITOR" page.. Is there any available hook/filter for it?
0
votes
0answers
22 views

How to select a template for displaying custom post type

Hi i know how to implement post types list in any page or template in worpress using code . for example $args = array( 'post_type' => 'home_banner'); $loop = new WP_Query( $args ); while ( ...
0
votes
1answer
17 views

How to set default archive image without overriding first attached image?

I have hit a wall. I have archive pages with some posts that have featured images which display fine. Some posts don't have featured images but the first attached image displays. Some posts have no ...
0
votes
0answers
23 views

How to filter Wordpress menu by tag name of the post

I have a simple wordpress theme installed on my server. The url is : http://urhalpool.com/wp/ I have used tagging against my post and those post added to my top and left menu. When I am filtering by ...
0
votes
0answers
6 views

Missing argument 2 for remove_widget_title() [duplicate]

I'm using both these functions: function widget( $args, $instance ) { // Widget output extract( $args ); $title = apply_filters('widget_title', $instance['title']); echo ...
1
vote
3answers
28 views

Alter only the page title, not the post titles within

I have a page where, with shortcode, I queried multiple posts from a CPT - so the page is one kind of archive page to the general users. Page Title - CPT Post Title #1 - CPT Post Title #2 - CPT ...
0
votes
0answers
9 views

Filter to set a variable once a post is populated?

I'm working on a playlists plugin. The playlists are just custom post types; and they have extra properties I need to populate once a 'playlist' post is loaded. So the idea would be to have a ...
0
votes
2answers
35 views

Warning: Missing argument 2 for widget_title filter

Based on this question, I'm getting an error Warning: Missing argument 2 for.... This happens for some widgets those are created by plugins. -- Edit 1 -- Here's a simple widget that causes the ...
4
votes
2answers
74 views

Whats the difference between post_limits and pre_get_posts?

Because of the lack of documentation about post_limits, its hard to learn more about this function and when to use it. Never used it before or seen it used so maybe its not to be used? function ...
0
votes
1answer
34 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
13 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
19 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
26 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
21 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
15 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
53 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
36 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
23 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
19 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
44 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
30 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
35 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
49 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
23 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
48 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
28 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
38 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
14 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
30 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
44 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
51 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
31 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 ...