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

learn more… | top users | synonyms (5)

0
votes
1answer
77 views

remove_action not working, even after changing priority [duplicate]

So one of the functions in my theme is: public function job_manager_job_filters_distance() { //Show some HTML } And somewhere else in the document lies: add_action( '...
0
votes
1answer
38 views

How can you wrap add_filter with a if is_home() statement?

I have the follow code: if ( !function_exists( 'df_excerpt_more' ) ) { function df_excerpt_more( $more ) { return ' &hellip; <a class="more-link" href="' . esc_url( get_permalink( ...
3
votes
1answer
57 views

wp_get_attachment_url filter won't accept two arguments

Here is the specification for the filter for the wp_get_attachment_url filter: /** * Filter the attachment URL. * * @since 2.1.0 * * @param string $url URL for the given attachment. * @...
-1
votes
1answer
40 views

add_filter adds output in the head

I build plugin and I have a problem I add to plugin: add_filter( 'the_content', myFunction); function myFunction() { $options = get_option('myPlugin_settings'); if (is_page($options['...
1
vote
0answers
184 views

Can't get wp_title filter working in twenty sixteen child theme

I am having difficulty overriding the title set in the admin panel for a custom template page, and outputting a custom <title> tag. The parent theme is WordPress's stock Twentysixteen, which ...
2
votes
1answer
38 views

How can I add information underneath the user's name on the users.php page?

I know how to add columns to the users.php users page with manage_users_columns and manage_users_custom_column, but I don't know to modify the information shown in the default columns (e.g. username, ...
0
votes
1answer
67 views

How to append to title via functions.php for auto-posting plugin [duplicate]

What I've got so far I've finally got the functions.php plugin to append a string to custom post titles of a certain post type with this function: function append_album_review_to_title( $title ) { ...
0
votes
2answers
77 views

Template filter for custom taxonomy terms

I want to replace custom taxonomy term template with my custom template. Like using add_filter('single_template','customFun'); replaces single custom post type template. I have a custom taxonomy e.g ...
0
votes
1answer
49 views

wp_editor customization

I've been stuck in a simple issue for the last couple of hours: I'm developing a website in which I use several wp_editor instances, all with custom buttons and styles. This is very simple to achieve ...
0
votes
0answers
22 views

Ajax filter already filtered custom post list

Clearly relatively new to WP so this might be a dumb question but here it goes. I was able to fetch a custom post list of filtered posts in a specific price range (max.value of $100). Now I want to ...
0
votes
1answer
113 views

How do I remove p tag *insertions*? Disabling `wpautop` removes manual tags

I am trying to post static pages with HTML content. So I need to disable wpautop, but when I do this my content is stripped of all <p> tags it has. I remove the wpautop filter from my header....
0
votes
0answers
32 views

Is there a way to capture http request variables and provide different content?

I want to implement a rest webservice on top of wordpress. That means that for a given content type (custom), if the request either cotains something like ?format=json or the http negociation accepts ...
0
votes
1answer
24 views

Extracting a TLD from the content and assign to custom field

I am trying to get the first instance of a TLD in a post and insert it into a custom field. For example with a post: Hi I am Bob. My website is http://bob.com and you can reach me at bob@bob.com ...
0
votes
1answer
58 views

How to add custom nav_menu_css_class to certain menu only?

I want to add a custom CSS class to menu items. So far, I got it working by using the filter hook nav_menu_css_class. However, I want to add this class to items of a specific menu only. So, how must ...
0
votes
1answer
63 views

Display only text to WordPress loop without loosing the text formatting

I want to display text from content (only text) with the formating (paragraph, bold, italic.) on loop. When I am using this code: <?php echo mb_substr( strip_tags( get_the_excerpt() ),0,255); ?>...
0
votes
0answers
21 views

Use of filter gives error of “backup of this post in your browser is different from the version below”

I have made this small filter function to rewrite uri of images to a cdn hostname. As soon as i click "publish" or update i get this error backup of this post in your browser is different from the ...
1
vote
0answers
21 views

HTML and custom field variable, inside variable

I'm trying to get data from a custom field and then passing that into a variable which is then used to perform a function which is - adding the tweet in the body of the_content(); This code was ...
1
vote
0answers
24 views

the_content filter on some post types only not working

I'm using a filter on the_content to insert an ad after the first paragraph of a post and it is working fine. But I'm also using a plugin called Live Blogging Plus and it uses a post type called ...
1
vote
1answer
32 views

Get categories with posts by custom field value

I have a big categories tree (~2000 total subcategories)... And I have a lot of posts with custom field "city" (different values). I have created filter posts by "city" field. But I have problem with ...
1
vote
1answer
37 views

WP_Query with different postmeta filter for each categories

Let's say I have categories (cat1, cat2) and I have postmeta keys (date1, date2, status). How do I view all posts in all categories with these filters: For cat1, I want to apply WHERE date2 <= $...
2
votes
1answer
52 views

IF Statement in Wordpress

I can't seem how to correctly use the php if statemnt in my add filter function below. This code works perfectly if all (3) of my $_POST inputs have values however it has a fatal error if any are ...
1
vote
0answers
24 views

Process all virtual sub pages on parent page

My parent page: http://example.com/id Virtual pages are: http://example.com/id/1563 http://example.com/id/john/5896 http://example.com/id/jack-miami/3054 I use shortcode in parent page that gets ...
2
votes
1answer
145 views

Check if page parent has certain template

I want to check if a page has a parent with a certain page template attached to it. If I know that I can determine which scripts to load or not. Normally I would just get the page template and if it ...
1
vote
0answers
15 views

Building a request processor for multi-page forms, etc using $_GET requests

Good day, What I'm trying to accomplish in a semi-elegant way today is building a multi-step form type thing. Essentially, I'm trying to rewrite the page based on a $_GET request. Like, say, it's /...
1
vote
0answers
126 views

How to use jPList with search results

I've been working on a real estate site and looking for a way to refine search results page + update pagination, instantly, like the big name sites (ie hotpads.com, trulia.com, hotels.com, etc.). ...
2
votes
1answer
25 views

failed to filter hook `get_terms_defaults`

I've failed to filter hook get_terms_defaults, I got this notices and it won't to load any term Notice: Undefined index: number in /var/www/html/wp-merwaa/wp-includes/taxonomy.php on line 1123 ...
1
vote
0answers
45 views

wp_upload_bits Upload Specific Sizes Only

For images uploaded using this code, I want to only upload the full-size image and the thumbnail (whereas for images uploaded through site, I want all sizes). However, I can't figure out how to make ...
0
votes
0answers
20 views

How to remove the function hooked to action within a class [duplicate]

I want to remove the function listify_single_job_listing_meta which is hooked in action inside the following class class Listify_WP_Job_Manager_Template extends listify_Integration { public ...
0
votes
1answer
53 views

wordpress filtering out caps in wp_title? (UpperCase is changed to Uppercase)

Have been working with WP for years, but never noticed this until today: I have just launched a new site for a customer, and they write their name like this: "ClientName" (with one letter capitalized ...
0
votes
1answer
51 views

What problems could happen if I replaced add_filter and add_action with the function calling

I'm new to WordPress, and to learn more about how to build WordPress themes, I'm now analyzing the code of a theme I downloaded and trying to make some changes in it. Two of the built-in functions in ...
1
vote
0answers
28 views

add_action shortcut?

I think in PHP 5.4 or above (don't remember the exact version), instead of writing: function some_function() { } add_action( 'init', 'some_function' ); One can pass an anonymous function: ...
0
votes
0answers
38 views

Jetpack filter hook for twitter publicize post

I would like to know whether is there any filter hook in jetpack plugin which gets called before post get published on twitter through jetpack using publicize feature. I browsed many times, but I ...
5
votes
2answers
194 views

How to list some posts first in the loop based on post id

I have a query for to display some posts . $args = array( 'post_type' =>'products' 'posts_per_page'=> 12, 'orderby' => 'meta_value_num', 'meta_key' => '_price', ...
0
votes
0answers
17 views

Web User Selects Image Category

I'm trying to build a website in wordpress where the user of the webpage can select an image category that they want to see (e.g. all images of boats). The user will have a dropdown list or some other ...
4
votes
2answers
150 views

Change “You are now logged out” text

I want to wrap <strong></strong> around the words "logged out": add_filter( 'gettext', 'wpse17709_gettext', 10, 2 ); function wpse17709_gettext( $custom_translation, $login_texts ) { ...
1
vote
1answer
123 views

How to add a class to Tag cloud widget link?

I am currently trying to add styles to the links in the Tag Cloud Widget which I can see uses wp_tag_cloud() to output the cloud itself. The args in wp_tag_cloud() don't include a classname which is ...
2
votes
1answer
43 views

Limit filter upgrader_post_install to a single plugin

I am using the following filter to run a function that generates a CSS file after a plugin gets updated. Currently the CSS gets generated when any plugin gets updated. Is there a simple way to limit ...
0
votes
1answer
53 views

Dynamically adding filters

I have a function that I'm trying to get an array in it to use in a callback to dynamically add filters. Here is the function that I need to retrieve the array keys from ( in the $classes variable ): ...
0
votes
1answer
32 views

when use function the_content break

i use the function below to show content under the_content. It works on pages which uses template-test.php. But on other pages the_content stops output. function beschreibung_kriterien( $content ) { ...
0
votes
1answer
66 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
272 views

How remove woocommerce title on category page only by PHP

How to remove woocommerce title on category pages only (by PHP) and keep rest of titles (on search result page for example) visible? thx
0
votes
0answers
65 views

Filters, priority when run after plugins_loaded

In my main plugin I filter the_content to add rich snippets. Something like this: add_filter('the_content', 'add_schema'); function add_schema( $content ) { $schema = NULL; //To avoid undefined ...
0
votes
1answer
33 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
39 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
1answer
64 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
43 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 ...
0
votes
0answers
88 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
1answer
124 views

WooCommerce: Add Payment Gateway Field to Webhooks [closed]

I have created a custom Payment Gateway for a special EFT system we have setup. The Bank Account and Routing Number are supposed to get encrypted then sent to a Salesforce via the WooCommerce webhooks ...
0
votes
0answers
57 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 ...
6
votes
1answer
347 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 ...