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

learn more… | top users | synonyms (5)

0
votes
1answer
20 views

How to check which submission button was clicked?

So I added a new submission button to the edit page: Using the post_submitbox_misc_actions hook with the submit_button($text, $type, $name); function. I wanted to modify the data that's saved based ...
0
votes
1answer
25 views

Keeping the previous get value and add another value when submitted

I'm a super noob, so I'll try my best to explain. I have a blog page that I wanted filtered by category and I want the user to able to click on multiple categories and it will filter to show those ...
0
votes
1answer
16 views

Filter page title (displayed in browser tab) of wp-login

For wp-login.php, the default page title, as displayed in the browser tab, is "Log In". I need to change this value using a filter in functions.php. Every solution I've read addresses the header ...
0
votes
0answers
26 views

Filters, priority when run after plugins_loaded

in my main plugin I filter the_content to add rich snippet, something like this: add_filter('the_content', 'add_schema'); function add_schema($content) { $schema=NULL; //To avoid undefined ...
0
votes
2answers
1k views

Filter categories using tags

I have a website with the following categories: Videos Pictures Stories And I have a lot of tags like: Funny, Awesome, Mind Blowing, Crazy, etc. Is there a way I could filter lets say: Videos ...
0
votes
1answer
519 views

Empty string supplied as input when parsing content

I have this code: <?php function mb_find_my_image( $content ) { if( is_home() ) { /* if is home start */ $dom = new domDocument; $dom->loadHTML($content); ...
4
votes
2answers
100 views

Using variable from one filter in another filter

I have a filter for the Gallery Shortcode where I grab IDs for images used in a post and using the IDs I grab their meta data. Now I need a way to use the $copyright variable in a filter for grabbing ...
0
votes
2answers
472 views

apply_filters, EMBEDS and AJAX not a friends?

I encountered a problem... There is content that contains a YouTube link Lorem ipsum bla bla bla http://www.youtube.com/watch?v=nTDNLUzjkpg My plugin display this content with that code in the ...
0
votes
1answer
25 views

How to get the postID inside 'content_save_pre'? Other hook?

I need to get the current PostID. I think in the function the postID is not existing yet. (Because save pre ...) add_filter('content_save_pre', 'getImageUrlOutOfContent', 10, 1); Am I right? How I ...
0
votes
0answers
18 views

Filter by custom field - dropdown POST not working

I have a custom field "carbz" which has a number value. I am trying to give users a dropdown to select a number and then filter my posts based on the user's input. The current result is returning all ...
8
votes
1answer
5k views

What is the very earliest action hook you can call?

After the solution to this question was to get a function to launch BEFORE the init action is fired by taking the sequence out of its function, it got me thinking, is there any earlier in the WP load ...
6
votes
1answer
114 views

wp_headers vs send_headers. When to use each?

I've seen wp_headers and send_headers both used before for the same thing and I'm wondering how you're suppose to know which one to use and when... On the send_headers codex page there's an example ...
0
votes
0answers
17 views

Multiple taxonomies in URL filter (both AND and OR type)

I'm working on a webshop that's running on Wordpress+Woocommerce. I can't find a way to filter the products via URL by custom taxonomies with the OR operator. Filtering with the AND operator works ...
0
votes
0answers
34 views

My Wordpress url has ?c=6d1368cfbaef at the end

I am new to WP. I am currently building a WP woocommerce website using the theme Envato Bookstore. Active plugins installed: Header and Footer LayerSlider WP PDF Product Catalog 2 (BETA7) for ...
2
votes
1answer
61 views

Removing labels and <br> tag on WordPress's default login form

I am customizing the login form to more closely resemble Google's minimalist form, which has no form labels, and instead relies on placeholders to prompt users for the input fields. The form starts ...
0
votes
1answer
95 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
vote
0answers
28 views

ajax category filter

I know this is a big ask for you guys, but i can't seem to figure this out. I found this page : http://www.bobz.co/ajax-filter-posts-tag/#comment-28112 it shows how to make a dynamic filter for post ...
0
votes
0answers
21 views

Filter question list on substring of metavalue

On the admin page I want to filter posts based on meta values. I know using the pre_get_posts hook will allow me to filter based on specific meta values, however I want to filter on a certain ...
0
votes
1answer
56 views

Filter By Category Dropdown List With Custom Taxonomies

I have next category dropdown filter that atm supports only two levels "parent -> Child" and I want to get the third "parent -> child -> child". I have two functions: function ...
0
votes
1answer
35 views

Help me filter get_adjacent_post

I'm not keen on private posts interspersed with published posts on the front end, so I'm writing a plugin that seeks to segregate and separate them out. As part of this I want to modify the post ...
-2
votes
1answer
35 views

Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]

Hi is it possible to make an extra field in backend, when orders are selected and marked as shipped then an extra field come and where i can select drivers who are responsible for this shipped order ...
0
votes
1answer
34 views

How to stop wrapping comments in P tag

When I update a comment in wordpress, the comment is wrapped with p tag. Here's my code remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_excerpt', 'wpautop' ); remove_filter( ...
1
vote
3answers
537 views

Custom Post Templates

The Issue: I am looking for custom single post templates, to add or remove individual elements as a function of a normal single post. There are a lot of ways to create custom post templates for ...
4
votes
1answer
65 views

WP_Query - filter or directly?

The count of my files, templates, scripts, queries etc is getting big and I need a good system to maintain it all. I've tried to keep everything organized: No <script> tags in templates ...
0
votes
0answers
15 views

How to add new tab and data in Wordpress Users section

I have to add new tab and new data in wordpress users. Please see the image below. The points tab came from the plugin mycred but i don't know what was used. What I think was it was done using: ...
1
vote
1answer
52 views

Hide posts of a certain category unless logged in

I want to hide posts belonging to a certain category unless logged in. I found some code(attached) in the codex that works great for the loop. But how to ensure the post pages are empty as well? ...
0
votes
1answer
36 views

shortcode function outputs multiple anchor tags

I have a shortcode function which displays the latest news, the code for a news item is as follows: $html .= '<div class="latest-news">'; $html .= '<a href="' . get_permalink($recent["ID"]) ...
1
vote
2answers
3k views

How to only hook on Single.php after content?

I am currently hooking on the_content() but that goes through the Wordpress loop too. How can I only hook on the Single.php page? Also, is there a way to only look on the first X posts in the ...
3
votes
1answer
5k views

Where is the best place to use add_filter

Should I use the function add_filter In my plugin's init action hook or just the in the main plugin script? Since sometimes I found people is using filter all over the place and if I put in the init ...
2
votes
1answer
2k views

Explanation of the “posts_join” and “posts_fields” filter hooks?

I'm new to the "posts_" filter hooks and wanted to know a few things from those in the know: In this question, someone posted an answer using posts_join that took a second parameter of $query: ...
3
votes
2answers
100 views

Filter by custom field in custom post type on admin page

I've used Advanced Custom Fields to create custom fields for Competition name, answers etc. I've made a custom post type for competitions as shown on the image and I used Wordpress functions.php to ...
7
votes
3answers
987 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 ...
1
vote
0answers
44 views

Prevent 404 when using pre_get_posts to filter an archive page

I have added a custom taxonomy named "area" to the default "post" post type. It's meant to organize posts by geographical area. In category pages I've added a dropdown that allows the user to filter ...
2
votes
1answer
345 views

Sort search with posts_orderby

I need to sort my search results by custom post type. the problem: the order is custom. I do have 5 different post types and i got the order like so: artist artwork page post publication I'd like ...
0
votes
1answer
35 views

Adding html banner to posts

I'm writing a plugin that adds a banner to the top of all blog posts. I'm using the_content filter and just pre-pending some html to it. When doing this, the html isn't shown in the excerpt, but I ...
1
vote
0answers
21 views

Filtering posts by user role [closed]

I have created some custom roles in my Wordpress installation. Now I want to filter the posts they can see and edit based on a custom field criteria. How can I define this behavior in a custom user ...
5
votes
1answer
247 views

Query WP REST API v2 by multiple meta keys

Using v2 of the REST API, I'm wanting to query some posts by multiple meta keys. With v1 I was able to format the url like &filter[meta_value][month]=12&[meta_value][year]=2015 and it worked ...
1
vote
1answer
23 views

How do I add a checkmark to my-sites save settings hook

I want to add a checkmark to the my-sites.php through a hook and then press save settings and have it do a function that executes a SQL query. I've added the checkmark but I don't know how to go ...
0
votes
0answers
21 views

add_filter priority not working

I have a must use plugin that adds the featured image to a post. I do this by prepending the featured image to $the_content through the use of: add_filter('the_content', 'featured_image_function', 1) ...
0
votes
0answers
20 views

Dynamic Search without needing to reload the webpage

I'm wondering how can I customize a dynamic search filter for my Download page. I'd like it to respond real-time as soon as I type something, and as far as I know AngularJS provides that. Is there any ...
12
votes
2answers
21k views

WordPress hooks/filters insert before content or after title

trying to insert content before the post content in my functions.php - I know how to use the regular wp hooks, but unsure how to insert into other areas. Tried this, but it kills content on any other ...
1
vote
1answer
752 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
0answers
7 views

WooCommerce cart notices as single concat string

So currently WC displays cart notices by looping through an array, making for a kind of ugly list at the top of the cart when the user forgot multiple required fields. I would like to filter this ...
4
votes
2answers
45 views

syntax for remove_filter in parent theme with class

I'm trying to remove a filter on the register_url hook a parent theme added, that seems to have a class nomenclature I can't figure out. Ordinarily, a filter for this hook would be easily added like ...
0
votes
0answers
6 views

Add current user filter on WordPress's default celendar

I want the WordPress default calendar to only show the posts from the current logged-in user. Not the entire posts of the site. I had to hack the general-template.php to do that but really need to ...
0
votes
0answers
18 views

Create plugin to modify custom field values

I've developed a plugin which outputs a list of events into a widget. To display event details I created a generic page with shortcodes and the plugin populates shortcodes with event details. This ...
3
votes
3answers
375 views

Define custom Page Template without its own .php file

Is there any way of defining a Page Template from some function/filter/hook, without having any .php file containing the comment at the top of the page to declare the Template Name? For example, ...
0
votes
1answer
40 views

Modify page title and subtitle with a plugin

How can I build a plugin which will modify a title (header) of the page? I built one generic page which uses shortcodes to display relevant information based on url parameters, but I can't use ...
0
votes
0answers
18 views

Adding a taxonomy filter

I'm am attempting to add a custom taxonomy filter. I have partially achieved this, I have a dropdown menu that displays all of the desired terms. However when I actually attempt to filter on these ...
0
votes
1answer
22 views

Wordpress user account activation

How to implement user account activation in WordPress, it's not a multi-site. Once user registered through site or admin panel, user should get an email with activation link. Once the link opened ...