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

learn more… | top users | synonyms (5)

0
votes
2answers
15 views

How to filter url on post submission?

I would like to swap out image URLs upon post submission on both content editor field and a custom field cover_image of a custom post type article. For example, the original content may contain image ...
0
votes
1answer
26 views

apply_filters with multiple args and multiple add_filter

I'm using apply_filters to bridge the gap between plugins but am struggling with the arguments. There is one argument, an array, there are several implementations of add_filter to match apply_filters ...
1
vote
1answer
834 views

Using add_filter() in Widgets

Just have a query reference the add_filter() function. Can you use this function inside a WordPress widget class. Example I have a widget with dynamic created code that I want to pass to another ...
1
vote
2answers
26 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 ...
-5
votes
0answers
13 views

add_filter( 'post_thumbnail_html') vs wp_get_post_categories($posts[0]->ID) [on hold]

Hi there I have a problem bacause of: function my_post_image_html( $html, $post_id, $post_image_id ) { $sowot = wp_get_post_categories($posts[0]->ID); $large_image_url = ...
0
votes
2answers
663 views

Create subpage - filter parent pages list

I have a website here with a lot of content and with the content where is necessary to create pages in hierarchy. But it is uncomfortable to go through the dropdown in the administration with a lot of ...
0
votes
1answer
871 views

How to add nav menu items to a specific position within a menu

I'm adding login/logout links to a nav menu using the following code: function rp_add_login_logout_links( $items, $args ) { $link = wp_loginout( get_permalink( get_option( '...
0
votes
0answers
20 views

how to filter post only parent in admin list table

I make custome post type hierarchy and than i make some post consist of parent and child, on list table it showing like this : parent_1 child_1a child_1b parent_2 child_2a child_2b My ...
0
votes
1answer
19 views

Search content for shortcodes and get parameters

In content I can have multiple shortcodes like [book id="1"] [book id="14" page="243"] Is there any help method with which I can search the content for that shortcode and get its parameters? I need ...
0
votes
0answers
34 views

How to disable wp_trim_excerpt filter

I have a Divi child theme. I'm using the blog module to list out the blog posts. If the post excerpt field is empty, I don't want the post contents to be extracted instead. Having Googled, I came ...
0
votes
1answer
416 views

Let Users Filter Posts by Custom Fields

I'm using the Advanced Custom Fields plugin to add custom fields to my posts, but was wondering what is the best way to go about creating a filter box for the user to filter through posts. I've ...
0
votes
1answer
19 views

Add class to first post in custom loop using post_class filter

I am trying to add a class to the first post in a custom WP_Query. I can add a class to the first post of the standard WordPress loop using; add_filter( 'post_class', 'featured_classes' ); function ...
0
votes
0answers
19 views

How to find all the available hooks in a theme

I have invested time and money on a Wordpress theme with a terrible support service. I have to fix bugs and implement new features myself. But I prefer to do it through filters and hooks. For example:...
0
votes
1answer
20 views

What is the action hook to use if you want to capture the new password during password change?

Clicking the Update Profile button in the [wordpress]/wp-admin/profile.php admin screen will allow the user to update his/her profile including the password. What is the right action hook to use ...
0
votes
1answer
13 views

Change url to posts if they have custom tax only

I have custom taxonomy "category_slider". function taxonomy_slider() { $labels = array( 'name' => 'Категории проекта', 'singular_name' => 'Категории', 'search_items'...
1
vote
1answer
412 views

display only the wp_nav_menu, which has the current-menu-item

i have a problem displaying only the menu with wp_nav_menu, in which the current-menu-item is in. Heres what i got: function register_menus() { register_nav_menus( array( 'sidebar-menu' =...
1
vote
1answer
3k views

ajax for filtering posts by category in wordpress loops

I've been looking around for a way to filter my posts on http://www.waziproject.com/wazimagazine/ without reloading the page. So my question is if anyone can help me out to turn the following into a ...
0
votes
2answers
474 views

Can i use multiple 'the_content' filters?

I am currently using a 'the_content' filter to add some HTML to the bottom of my posts and pages. But, I want to add another 'the_content' filter to a handful of specific pages (using page IDs). Is ...
1
vote
2answers
887 views

Force hide custom field metaboxes

How can I completely remove the custom fields and the collapse button in the Edit Post/Edit Page custom screen, but without removing the capability to add custom fields with a PHP function?
2
votes
1answer
940 views

SSL certificate for the host could not be verified

I'm getting this error in a log file created by WooCommerce "The SSL certificate for the host could not be verified." The error is being generated by WordPress' file /wp-includes/class-http.php ...
1
vote
0answers
25 views

How to get list of all hooks of current theme / plugin?

I want to get the list of all available hooks from active theme / from a specific plugin. I was tried to get it from global variables $wp_actions & $wp_filter But, They are showing all registered ...
1
vote
1answer
447 views

Walker_Nav_Menu doesn't work in wp_page_menu_args filter

I need to hide certain nav items from the menu (based on the password protection functionality) and I'm having trouble getting my custom Walker to work. In fact, I can't even get the standard ...
0
votes
0answers
15 views

How to use $prev_url and $next_url to display posts only out of a specific category

Struggling with a function used to display a previous and next button on a single portfolio page. I have set two pages up with display of a portfolio. Each page displays a portfolio with a unique ...
0
votes
3answers
2k views

How to append new form elements in “Add New” form of Users in Wordpress admin panel?

I'm developing a WordPress plugin and I want to append some extra form fields in add new form of Users section inside admin panel without editing core files. Can somebody help me in achieving this.
1
vote
2answers
613 views

How to use the 'comments_number' filter?

I'm not sure how to use this filter. Could someone show me an example? I'm trying to change ('0', '1', '%') to ('0 Comments', '1 Comment', '% Comments'). I'm using this function to get the comments ...
1
vote
2answers
309 views

Insert HTML just after <body> tag

I am using the Wordpress theme Twenty Twelve (a child of it to be precise). I want to know how to insert some HTML just after body opening, in just functions.php and not using header.php. Is that ...
0
votes
0answers
22 views

Custom default Gravatar with random function

I want to alter the default comment avatar behaviour on my WordPress site. As far as I understand the avatar_defaults filter can only do a static default avatar, but I'd more go with a random ...
0
votes
1answer
427 views

How do I safely force get_theme_mod() to use a defined get_option(“stylesheet”) value?

In our development process we have several branches of the same theme for each developer. Theme branches live in different directory names, so when doing get_theme_mod(), get_option("stylesheet") can ...
1
vote
2answers
712 views

list category posts under its item in menu

When adding category to Menu, I need it to list all the item that belong to that category in separate UL automatically. like this http://i.stack.imgur.com/ulOOS.jpg Of course I can do that manually, ...
0
votes
2answers
2k 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
78 views

What is the proper/best way to have multiple add_filter for wp-job-manager-resume

What is the best/proper way to implement multiple filters from one function or using my add_filter one time? If I can not combine multiple functions or actions in my one filter what is the proper ...
2
votes
4answers
8k views

Not able to change wp_title using add_filter

I have a custom page where I try to change the page title. The function executes, but the title is not changed. This is the code I'm using: add_filter('wp_title', set_page_title($brand)); ...
0
votes
1answer
567 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) { console.log(...
0
votes
1answer
98 views

WP Job Manager - display search results from custom search form in taxonomy-job_listing_category page

i want to ask something about wp-job-manager plugin. i have been already created a taxonomy_job_listing_categoy template to list all jobs from a certain job category. You can see an example here: http:...
3
votes
1answer
85 views

Exclude filter on front page

I am using this code in functions.php to append a button for link to a post. function new_excerpt_more($more) { global $post; return '<a class="excerpt-readmore" href="'. get_permalink($post-&...
0
votes
1answer
119 views

Are href attributes of a elements filtered on output to add the current path?

I have some code that basically looks like this (it's more complicated, but even this example shows what I'm running into): echo '<a href="#">TEST</a>'; However, what gets sent to the ...
0
votes
1answer
86 views

Add Adsense code between job listings - wp job manager plugin

I am using the wp-job-manager plugin and i want to add an Adsense code between the job listings ( after fifth job listing ) in the page with [jobs] shortcode. The function that outputs the jobs ...
0
votes
1answer
25 views

How to allow users to view pending posts of a specific custom post type?

I have a form on the front end that allows users to post a custom post type. The posts enters the database as pending for later moderation, how do I allow users to view these posts on the front end? ...
0
votes
2answers
64 views

Is there a wildcard/catchall filter hook?

I would like to filter all the options values, but the option filters are option specific. Is there a way I could do something like add_filter('pre_option_*', 'my_check'); ?
6
votes
4answers
291 views

Issues with title-tag and document_title_parts

Wordpress version 4.5.1 I'm trying to dynamically update page titles on a particular template. After lots of digging and learning about the wp_title() changes, I'm attempting to use ...
3
votes
1answer
42 views

Creating search filter through plugin

I'm using wordpress for real estate project, for that, I am using a theme together with a plugin (realia real estate) to real estate. So I believe that this not is beside the point ... My question is ...
0
votes
1answer
637 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); $dom->...
1
vote
0answers
21 views

Filter multiple custom fields Values with Check boxes

I create check boxes with name of custom field value. Here is 2 custom fields and every field have 2 type of values. need to show filter result of selected boxes?? every custom field have two type ...
0
votes
2answers
24 views

Prevent add_filter being applied to wp-admin pages

I'm applying a filter to a custom fields plugin. add_filter('acf/load_value', word_swap); My problem is this applies it to pages within the wp-admin also. I only want the filter applied to the ...
0
votes
2answers
41 views

How to apply a filter to everything?

I'm wanting to apply a filter to everything. add_filter('the_content', word_swap); Is there a term I can replace the_content with that'll target all functions?
0
votes
2answers
537 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
153 views

How-to inspect filter-able $vars?

Note: This is more of a tutorial/wiki than a real question and should be a reference for later Questions. If you got something to add, please feel free to add an answer. Working answers get upvoted. :)...
1
vote
0answers
48 views

Filter $cpt categories to omit certain category

I have 5 categories (with matching slug id's), 'deps', 'duo', 'five piece band' and 'soloist' as part of my 'portfolio' custom post type. I want to display everything but 'deps' on one page, and then ...
0
votes
1answer
21 views

menu-item class missing on wordpress menu

I have this code in my header.php and its working properly except showing li's without menu-item class, its showing them with page-item instead. this is when i dont have a menu created from admin and ...
0
votes
1answer
23 views

Output dynamic_sidebar_params in wp_head

I have created a custom widget with a color picker field. Currently there are two ways to output the color picker value for this widget: Inline style. Using the dynamic_sidebar_params filter. With ...