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

learn more… | top users | synonyms (5)

0
votes
0answers
2 views

Woocommerce order status based dashboard

I created several user roles based from the shop_manager. How do you make it that each type of shop_manager is able to see orders with a particular status from the orders dashboard? Example: ...
0
votes
1answer
15 views

Replace header image on all other pages but home - URL issue

I've got a function working to achieve what I want on my dev server, but it will not work on the live site. I have a random image implemented via shortcode and plugin, and it must appear everywhere ...
0
votes
1answer
12 views

Filter seems to be run before another filter although priority is set correct

First of all I want to mention that these are my very first experiences with wordpress plugin development. In the following I describe what I want to do and then describe my problem. I wanna use ...
0
votes
2answers
20 views

wp_insert_post_data filter hook identify current action

I have this function to set the title of a wordpress post which works properly for saving / updating posts. The major issue is that the function stops posts being deleted (it removes the title but the ...
2
votes
1answer
25 views

How to use update_{$meta_type}_metadata filter to modify meta value

I'm trying to wrap my head around the update_{$meta_type}_metadata filter, in order to modify both post and user metadata before database insertion. After reading the docs and the core, it seems to ...
0
votes
0answers
31 views

Wordpress category filter update subcategory

I'm building a new theme and i need to have an option at the top where there are three dropdown fields which represent three unique categories. The three categories are basically ( Country, City, ...
0
votes
0answers
17 views

is_page_template() doesn't work with excerpt_length filter

I am tring to set a different excerpt lenght for the pages that use an specific page templates using excerpt_length filter. This is the code: add_filter( 'excerpt_length', 'nmd_excerpt_length', 999 ...
0
votes
0answers
18 views

How to make a wp_title filter hook change the title column in custom post types reliably

I have written code for a custom post type. The custom post type is loosely based on the cpt-bootstrap-carousel plugin, but only as far as functionality goes. My code makes use of the ...
0
votes
1answer
40 views

4.0 remove_filter for Wordpress core function not working for me

I was trying to overwrite how captions are embedded into a page when editing in the admin. I simply did this: remove_filter( 'image_send_to_editor', 'image_add_caption', 20); add_filter( ...
3
votes
1answer
60 views

Pass all custom fields through the same filter on post load?

Is there a way to filter all custom fields on a post? Lets assume for very basic simplicity I have: standard fields of: title post body custom fields: author ISBN quote Lets assume on page ...
0
votes
0answers
14 views

If Specified Page then Redirect Elsewhere in Plugin

There's a few parent pages that only exist for URL purposes, but the actual page themselves need to be redirected to the home page since they're blank. I'm trying to make a simple plugin that will ...
0
votes
1answer
29 views

Removing posts from the returned wp_query. Cannot use object of type WP_Query as array

My end goal is to perform 3 custom field filters on a sets of filters on a WP_Query. The difficulty arises as I need to use both AND/OR relations between the 3 filters: field1 = A AND field2 = ...
0
votes
1answer
25 views

Override email_exists function

I am trying to override the email_exists function to modify the way it works slightly. It is not listed as a pluggable function so I am unsure how to go about it. I would like thef following to ...
0
votes
0answers
24 views

Using similar CPT rewrite slug and endpoint?

I'm currently using "details" as an endpoint to divide information from a CPT with many fields across multiple views. My URIs look similar to /location/location-name/details/rates/ I've got this ...
0
votes
0answers
24 views

Remove posts inside pre_get_posts using a custom query

I need to remove posts from admin listing, if their last child post author is different than the parent post author. I was hoping to use pre_get_posts, but can't figure out how to do this. Here's my ...
0
votes
2answers
29 views

Best filter to use for modifying custom fields on a post?

What is the best filter for editing custom fields on a post? I am not actually editing the post content but some related fields. Would it be add_filter('the_content', 'edit_custom_fields');? It just ...
0
votes
1answer
26 views

How to add a custom filter in functions.php

I have been through the Wordpress codex but I can't figure out how to write a filter. I would like to use a filter called: 'wpseo_sitemap_' . $filter . '_change_freq'. It expects you to return one of ...
4
votes
3answers
140 views

the_content and is_main_query

I am filtering the content with the the_content filter. Everything works perfect, excerpt that my changes are applied to custom queries as well. My changes appear in the sidebar as well if the widget ...
0
votes
1answer
44 views

run shortcode in excerpt of single custom post type

Hi because of the way my theme is set up, I need to run a shortcode inside the excerpt of a custom post type (services). This is the code I have so far... function ...
0
votes
1answer
21 views

Change name of existing post status type

I've been googling around, and struggle to find any solutions on how to add custom post status. Id like to add 2 a new status called "unread" I've seen the codex explaining how to register a new ...
0
votes
0answers
23 views

Add notice to add image popup

I have been using the global "pagenow" variable to add instructions for users, but I need to somehow hook into the add image popup as I would like to instruct the users on optimal resolution for ...
0
votes
1answer
34 views

Custom Search Template for Custom Post Types

I know this is asked a million times, and I've found the solution. It seems fairly straight forward but it's not working for some reason. I wonder if it has something to do with the fact that I'm ...
0
votes
0answers
37 views

Find field name and its applied filters

Currently, I'm trying to modify the calendar plugin in my Wordpress to accept line breaks in the field for the event's cost. I managed to remove the escape HTML functions from the views, i.e. if I add ...
0
votes
1answer
40 views

What is the earliest hook to modify post content?

I have installed a plugin that adds stuff at the end of the content. I just want to apply my modifications to the post content before this plugin does. In my case or otherwise, what is the earliest ...
0
votes
1answer
34 views

Bind a function with its own argument to show something dynamically after every content

I have a function that is grabbing something from database using a user-defined ID. I need to show the content after every post/page content. So I followed @s_ha_dum's solution from WPSE, like below: ...
0
votes
1answer
22 views

remove_action conditionally for Custom Post Type - not working

I'm using a Genesis child theme with the 'Genesis Co-Authors Plus' which enables support for 'Co-Authors Plus' I'd like to disable the author box everywhere except for the blog. Genesis Co-Authors ...
0
votes
0answers
25 views

How can I change the lost and reset password from action url?

This a second part to my original question posted via the following link How to change/rewrite the lost password url? Submitting the lost and reset password from generates a 404 because there action ...
0
votes
1answer
37 views

How to change/rewrite the lost password url?

I used iThemes Security (formerly Better WP Security) hide back-end functionality to change the login url to /signin however clicking the lost password link /wp-login.php?action=lostpassword now ...
0
votes
0answers
25 views

Wordpress Apply filter in plugin causes 500 internal error

I use the plugin https://wordpress.org/plugins/show-post-in-lightbox/ to display all feautered image of every post on a page. whenver one of these images get clicked on a lightbox will appear showing ...
1
vote
1answer
59 views

Customize the “Registration complete. Please check your e-mail.” message on WP 4.0

How do we customize the "Registration complete. Please check your e-mail." message that appears when registering on WordPress 4.0? In previous versions, Dave Ross solution worked: add_filter( ...
0
votes
1answer
35 views

How to modify only part of a function through the filter

I'm trying to edit part a function that validates user registration and I need to change the language of the error response because I modified sanitize_user() to disallow "@" and ".". So I need to ...
1
vote
0answers
24 views

Create Search Form to Filter Through Terms

I have pages that displays a list / grid view of all my taxonomy terms. Over 200 terms. The page is paginated since there are so many terms, however, I would also like to include a "search" box at the ...
1
vote
1answer
31 views

Is it acceptable to treat a filter like an action?

The wp_insert_attachment_data filter is available inside wp_insert_attachment(). It allows attachment post data to be filtered before it is updated in or added to the database. $data = apply_filters( ...
0
votes
1answer
37 views

Removing URL and adding container around image in the featured image metabox

I want to remove the url and add a container(div) around the image in the featured image metabox. Wordpress output <p class="hide-if-no-js"> <a title="Set featured image" href="URL" ...
0
votes
0answers
18 views

Custom xmlrpc request does not pass parameters?

Here is what I have: function xmlrpc_login($args){ //this code actually runs var_dump($args); // is NULL ...other logic that needs the args values... } function ...
0
votes
0answers
25 views

Wordpress gallery shortcode - include author's images

I'm using the built-in wordpress gallery shortcode to display all images of a category -- documentation found here: Wordpress Gallery Shortcode Codex --- By using [gallery category="1"] How could ...
0
votes
0answers
18 views

add_filter not adding the filter

i am adding a filter at the end of my themes functions.php if( !function_exists( 'mars_widget_post_ids' ) ){ /** * @param array $query * @param string $widget_id */ function ...
0
votes
1answer
29 views

Add rel to all images in a post

I want to add a rel to all images in a post. I am trying following filter but it will wrap only the images which are in the gallery. It does not wrap the images which are added individually without ...
0
votes
1answer
34 views

How to add a filter conditionally based on page related Conditional Tags

I am developing a WordPress plugin and can't conditionally add filters based on the conditional tags. This is my code: add_Action('init', 'determine_location'); function determine_location() { $d = ...
0
votes
1answer
38 views

change attachment custom field onChange event

The form is in post creating window. Ajax is posting values, but the values doenst renews. Where can be problem ? Ajax <script> function dynamic_Select(field, aid, value) { ...
0
votes
0answers
18 views

attachment custom values are'nt inserted to database

I have created attachment custom field. After I uploading image and inserting to new-post.php (post creating window) no meta values are saved in database. Even that I have set a default value for ...
0
votes
0answers
15 views

Modifying Search to Exclude results from within short code or HTML

I've been struggling with this one for some time and I was wondering if anyone has any ideas on how to fix this. I'm not asking about stripping out short codes or HTML from the excerpt, that's fairly ...
0
votes
0answers
13 views

Show post categories names using apply_filters

I'm trying to change a plugin for each post show his categories names. The plugin use apply_filters to show post name. But how can I show categories names? $output .= $indent . '<li ...
2
votes
1answer
95 views

How to filter the description of a custom post type

I understand that although not used by core in any way you can set a description for a CPT: $args = array( [...] 'description' => "My CPT description" [...] ); register_post_type( ...
0
votes
1answer
31 views

Adding to an array & passing it through do_action/apply_filters

For exercise I am working through a PHP class to add meta boxes I found on GitHub. I just copied the code and now I am playing around with it to understand it. It works like this: The file ...
0
votes
2answers
93 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 ...
0
votes
1answer
79 views

query post limits

function posts_limit_fn($limit, $query, $custom_limit = ''){ if($custom_limit !== ''){ return $custom_limit; } return $limit; } this piece of code is executed into an AJAX ...
0
votes
0answers
10 views

Dynamically display custom posts by custom fields

I am an intermediate PHP/jQuery developer and would just need a few pointers in the right direction (a tutorial would be great!) please; I have a custom post type of "Events" - amongst others, each ...
1
vote
1answer
74 views

Which built-in Wordpress files are safe to edit?

I begin to work with Wordpress, I'm developing a theme with many functionnalities into it, and I'm good with that. My question does not have to do with theme development, but more with general ...
0
votes
1answer
22 views

Which Filter Do I Use To Modify The Subject Of The Retrieve Password Notification Email?

I am looking for the filter that enables me to modify the subject of the "Retrieve Password" notification Email. If you know which filter to use, please let me know.