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

learn more… | top users | synonyms (5)

0
votes
1answer
11 views

Hook for altering the content of all wp mails

Hi i want to set email template for all mails for my site . I know how to set up mail template and i set mail template for each of my mail by editing the code ie wp_mail( $recipient, $subject, ...
0
votes
0answers
12 views

Populate Multiple dropdown

It's a bit complicated here. But I'm in real trouble right now. Let me explain I want 3 dropdowns populate by order. unless the first it will be disabled. product year (product custom taxonomy) x ...
0
votes
1answer
9 views

Unable to get Wordpress's apply_filters('site_url') to return a https scheme

I am in the middle of migrating a Wordpress site to being entirely https://, but I am having trouble with the login page. The login page itself is loading with the https:// scheme, but the form ...
0
votes
1answer
13 views

changing size image within the content

I'm trying to get my images inside the post may larger than 800px ; For this I took a function that resizes image here and I'm trying to create a function to my thumb inside the post come with size ...
0
votes
0answers
16 views

How To Sort and Filter Admin Custom Taxonomy Columns

I have a custom post-type with associated custom-taxonomies – how can I make these custom taxonomies sortable in the custom post-types admin/list view header (similar to how dates is sortable)? ...
0
votes
0answers
23 views

Modify content if has shortcode

I have a post or page , the content of that post or page is similar to the following Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et ...
1
vote
1answer
19 views

body_class filter - Is there a better way to write this code?

I would like to add a body class depending on what sidebars are active, and a body class if my before-header widget area is active. I have got it to work, but I would just like to know if there is a ...
0
votes
0answers
17 views

Create Searchfilter by Atribute

How to create a search filter by attributes in woocommerce? I like the default woocommerce layered nav widget but i want to build a searchfilter by attribute directly in the shoparchive just as i have ...
0
votes
0answers
6 views

hook for adding a new column in woocommerce subscriptions

I try to add a new column in Woocommerce subscriptions, I would like to know what hook i will need to display my new column Thank you Nilda
0
votes
0answers
9 views

Best way to filter posts being displayed on the fly

I got the following post structure: The search box is to illustrate what I want to achieve. CPT Videos: Videos being displayed in the image. CPT Artistas: Another post type for the artists. ...
0
votes
0answers
21 views

add_filter Add To Content, Not Replace Existing Filter Function Content

If I am trying to add content to the content generated by a plugin/core filter function - how is this accomplished? The specific situation I am attempting to accomplish - I want to add the widget ID ...
2
votes
1answer
54 views

How can I get next/ previous post links to order by a filter (by the last word of the title)?

I am trying to use the next/ previous post link functions by Wordpress to move between posts of a custom type based on the surname of a person. The custom type represents a person with a post title ...
0
votes
0answers
17 views

How to setup a new image size in a child theme?

I need to setup a new size for a thumbnail that will be used by a plugin but I can't get this done, this is what I have so far: /** * Registers a new image size. This means WordPress will create a * ...
0
votes
1answer
19 views

Filter Content on all Post Types

I had this idea to introduce a 'post type footer' using Advanced Custom Fields so that my users could set up common, reusable messages or calls to action and have them appear after the content of a ...
0
votes
1answer
19 views

functions.php filters not applied in AJAX call

I've added an element to a menu with php (code simplified for illustrational purposes): add_filter( 'wp_nav_menu_' . $menu_slug . '_items', 'add_menu_item' , 10, 2 ); function add_menu_item ( $items ...
0
votes
0answers
17 views

Adding placeholders to the sidebar-login widget plugin

It is my understanding that you may use the filters to code the placeholders to the plugin 'sidebar-login widget'. The programmer Mike pointed me to the code location where it should go: ...
0
votes
0answers
7 views

How to keep the sort order or filter applied in prev/next navigation?

I have an online shop (apartments for rent) using Woocommerce in Flatsome theme. The viewer can sort using the Woocommerce sort by dropdown menu, and filter items using Woocommerce filter widgets. ...
0
votes
1answer
32 views

Publish button inside custom field group

Is it possible to move the publish button out of the publish metabox, completely remove the metabox and then put the publish button inside the custom field group? Ask if you need more information, I ...
0
votes
1answer
36 views

Custom query with post_class filter using current_post not working

I have a new WP_Query on my archive page. I also have a post_class filter conditionally adding a class of first so I can display them in rows of 3 reliably. This is the post_class filter function ...
0
votes
1answer
21 views

Variables in post title

How can I make my post title dynamic? Let's say I'm trying to make a post with this title: Today is [day]/[month]/[year] [day] should be parsed into a php code that will retrieve the current day, ...
0
votes
2answers
30 views

hook filter after the_content on a specific page

I've made a function to hook after the_content. This is only working on certain pages/posts. It's working on the default template but not on my custom one's. function insertFootNote($content) { ...
0
votes
0answers
17 views

wp_get_attachment_link filter for not working for inserted images

I want to change the value of title attribute of attachment link of the image by caption. I am using following code. It works fine for the images in gallery. But when try to do this for the inserted ...
3
votes
1answer
80 views

Use REGEXP in WP_Query meta_query key

I know I can use REGEXP in WP_Query like this: $query = new WP_Query(array( 'posts_per_page' => -1, 'post_status' => 'publish', 'meta_query' => array( array( ...
0
votes
1answer
29 views

WordPress Permalink feature alternative

I'm trying to prefix my permalinks for some backend logic to emulate posts on Multisite. I have used the post_link filter but unfortunately it didn't meet my needs as it doesn't prefix the permalink ...
0
votes
1answer
10 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
2answers
28 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
18 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
30 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
38 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
18 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
21 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
32 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
36 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 ...
2
votes
1answer
79 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
26 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
59 views

add_filter to 'woocommerce_before_main_content' [closed]

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
55 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
38 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
22 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
1answer
20 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
28 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
32 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
11 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
39 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 ...
6
votes
2answers
93 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
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 ( ...