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

learn more… | top users | synonyms (5)

0
votes
1answer
17 views

Filter on widget-title does not work with custom links

I added a filter to my widget titles and it looks like the filter doesn't apply on links, which are created with the links-sidebar. It does work perfectly on the blogroll or search widget Here's a ...
0
votes
1answer
30 views

Print all inline styles to head

Currently working on a project here http://palanquin.shrimp-works.com. When I try to validate what I have done so far, using http://validator.w3.org/, I get lots of this error Element style not ...
1
vote
1answer
20 views

how to customize rss feed tags using hooks?

My RSS feed is displaying an XML tag which I either want removed, or emptied. The tag in the XML looks like so: <wfw:commentRss>remove/this/uri</wfw:commentRss> I have never used hooks ...
0
votes
0answers
21 views

Add filter on a plugin's function in functions.php [on hold]

I need to modify a W3TC function private function rules_core_generate_apache($config){ /* Code */ return $rules; } which generate .htaccess code, specifically I need to add a custom ...
0
votes
1answer
40 views

Custom view counts not updating correctly

I'm trying to add some custom views/filters to the list of posts for a custom post type in the admin. However, the query that counts the number of posts is updating the number of posts for all filters ...
1
vote
1answer
46 views

Changing a WordPress core function without hacking core

I am looking to change one line within a core function. The function is wp_allow_comment() located within /wp-includes/comment.php function wp_allow_comment($commentdata) { global $wpdb; ...
-1
votes
1answer
41 views

Underscores and capitalization in usernames [on hold]

I created a WordPress / BuddyPress / bbPress site that is used in conjunction with a PC game. When users register for the site, they are asked to enter their account name as it is in-game. The problem ...
0
votes
1answer
31 views

Hide H1 Title using the_title filter

I am trying to hide the pages H1 header IF a custom field specifies this. On a page back end I have added a custom field: Name = hide_title Value = true I then want to hide only the H1 using a ...
0
votes
1answer
132 views

Can't get content of all (19) posts - Incomplete Chunked Encoding

I've got some documentation stored in a WordPress install for something I'm developing, and I want to have a pure html, single page version of it in addition to the regular templated version which is ...
0
votes
0answers
19 views

wp_nav_menu: current_post_ancestor-category parent

I have a nav like this: page 1 -- page 1.1 -- category 1.2 page 2 page 3 When I am on a single post in the category 1.2, the category-menu-item gets the correct class current-post-ancestor and ...
0
votes
1answer
23 views

append PHP function to the_content

I'm using the Jetpack plugin for related items and social sharing. Both of these options filter the_content and append themselves to the end of it. The problem is that I'm using custom navigation in ...
0
votes
1answer
33 views

How to make the 'delete' button inactive on some categories?

As currently there's no way to declare any new custom post format in WordPress (3.9.1), is there a way I can make the 'delete' button on some categories inactive, so that the Editor can't remove them, ...
0
votes
1answer
79 views

Select All not working in a WordPress search filter

I am trying to create a Search Filter within WordPress to filter through all the custom taxonomies within a Custom Post Type. I have created a function that generates the dropdown so I can output ...
0
votes
0answers
37 views

Problem with adding values to 'post_updated_messages' filter

I'm having an issue with adding a filter to 'post_updated_messages' that I don't quite understand. I've written a function like so; function acc_course_updated_messages( $messages ) { $post ...
0
votes
2answers
151 views

add_filter the_content in functions.php not working

I want to add_filter for the_content in functions.php of my theme. I have added code which just display echo but it seams that my filter is not applied. function add_mod_hatom_data($content) { // ...
0
votes
2answers
76 views

Create new custom post and post category of same name

I have a custom post type "Product" and want to create a post category "A Product Name" automatically on creation of a new Product so that the post category (not custom post category) would have the ...
2
votes
1answer
84 views

Using hooks to place content in theme dynamically

Alright, so I think I may be getting a little too complicated on this, but I basically want to know if this is possible. I am using a content slide function where I display some thumbnails within the ...
0
votes
1answer
39 views

Return a custom value in a function added to an action hook

I looked into the difference between action and filter hooks, and as far as I understand, it is not possible to have a function, which is added to an action hook, return a (custom) value. My ...
0
votes
2answers
50 views

Admin filter/error if post title is too long

Is there a filter that will throw an error if the posts creator enters a post title that is too long? I am looking to throw an error like: "The title you've entered is more than 30 characters. Please ...
0
votes
0answers
4 views

How to remove a filter that has been added as a function [duplicate]

How can I remove a filter that has been added the following way: // Add the filter before executing the query add_filter('posts_where', function( $where ) use ( $lat, $lng) { return ...
1
vote
2answers
35 views

Dump contents of a variable inside a filter/hook callback that runs during save post

I just need to debug an array which comes into addfilter function like this: add_filter('pll_copy_post_metas', 'copy_post_metas'); function copy_post_metas($metas) { var_dump($metas); return ...
0
votes
1answer
38 views

Pre_Get_Posts order DESC not registering

I've created a filter function to filter a post type items by it's meta value _item_price. The problem is that it only works in Ascending Order and I'm not sure why. My pre_get_posts function looks ...
0
votes
0answers
27 views

Get media-uploader fields array

I want to modify the fields in the media-uploader. To do that I need to know what creates the fields. In the Codex, you can see a way to add new fields to the media uploader, using the ...
0
votes
0answers
48 views

External Script Using WP - Hooks / Actions Not Working?

I've researched this problem in depth, but still stumped. Simply stated, I have an external uploader script which loads WP. Yet I cannot seem to grab any of the actions/filters I've put into it. Why ...
0
votes
0answers
29 views

Alter any uploaded image BEFORE saving (apply blur or similar even on the original version)

I am looking for a way to add a blur effect or similiar to any saved image. I do not want to have the unaltered originals on my server. The reason is that I am sued for using a copyrighted image ...
0
votes
2answers
28 views

How to get any tag ID

I want to exclude a certain tag from my home page not a category only post that hold the tag for example "olive"; I found a function for that which is like this function exclude_tag($query) { ...
2
votes
2answers
89 views

Adding a class to the body_class function

Basically I've applied this way to show certain colors on pages like search.php or a list on home. What it does is it reads a variable that gets a field from WP, if that field is equal to a certain ...
1
vote
1answer
104 views

Remove “Get Shortlink” button in admin of custom post type

I want to remove completely this section under my title in my custom post type. (I don't need this because I use this only for content management). With this piece of code I can remove the ...
1
vote
1answer
377 views

Add custom menu item using wp_nav_menu_items filter

I have added a snippet to add a "Profile" link to my website navigation menu. My code: add_filter( 'wp_nav_menu_items', 'my_nav_menu_profile_link'); function my_nav_menu_profile_link($menu) { ...
0
votes
2answers
38 views

Remove pretty photo style and script if not exist!

I need to dequeue or remove style and script related to "pretty_photo" from my theme but load it again only when it called or needed i have this code in my functions.php ...
0
votes
1answer
149 views

Filter post query to only show direct children of category

Google seems all purple on this subject, if you know what I mean. I've searched for this topic forever to find a solution. I want to build a finder/explorer feel to my categories, so when browsing to ...
-1
votes
2answers
75 views

Edit Wordpress loop, taxonomies, & filter

I have managed to integrate a custom taxonomies plugin that: -Filters down the staff depending on what category is selected. I want it to show that department first, and then the other departments ...
1
vote
2answers
90 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
86 views

Custom Filter using meta_value in wordpress admin list not working

Hello I was trying to filter the pages using a custom filter in admin post listing of wordpress, but after selecting in the dropdown it returns nothing like its just showing all the posts and the ...
0
votes
2answers
181 views

Permanently remove first image from posts

I have around 2,500+ posts on my site where I've inserted images using the traditional method into the post content itself. In upgrading to a different theme, the single post page now displays the ...
0
votes
1answer
110 views

How To Get Search Term and Use in Function

I'm trying to write a function that will 'grab' the search term entered into the blog search form, and then hook the function to the get_search_query filter like this ...
0
votes
1answer
28 views

Is it possible to include the add_filter() function within a shortcode function

I am trying to pass content to the 'google_dfp_ad_slot' filter. Can this be done within a shortcode funcion? /** * Shortcode function to dynamically add google dfp ads to inline content and ...
0
votes
0answers
49 views

How to customize the “Insert/edit link” popup box?

is there a way to customize the "Insert/edit link" popup box in the editor so that it does something like this: Have a checkbox that says "Insert affiliate tag at the end of link" If the checkbox is ...
0
votes
0answers
16 views

Sort WP_Query by one meta key and post_date [duplicate]

I want to order by post to check for the existence of a meta key ('featured') and include those posts first and as a secondary option I want to sort by post_date, similar to 'sticky' posts on a ...
0
votes
1answer
121 views

Call to undefined function error after adding add_filter to wp-config

I am getting Fatal error: Call to undefined function add_filter() in example.com/wp-config.php on line 20 after adding add_filter( 'auto_update_plugin', '__return_true' ); to wp-config.php My ...
5
votes
1answer
111 views

How to auto-translate custom user roles?

I developed a small plugin that adds (or to be more precise: first deletes then adds again) some custom user roles. Each of these roles is set up in a way like this: function ...
2
votes
1answer
77 views

Restrict filter to run only inside specific function

I would like to filter get_terms(), but I only want to filter get_terms() when it is called from the wp_terms_checklist() function. I am looking to add a "No term" option to the end of my checklist ...
2
votes
1answer
28 views

Are there Limitations on filter handles?

I was looking through a 3rd party plugin's code today and found them doing this: add_filter('some_base_handle'.sanitize_title($string), ...) Curious, since I was using xh_prof to look for code that ...
0
votes
1answer
57 views

Adding body class when post contains a specific shortcode

Simple shortcode function : function my_shortcode_function($atts,$content=null){ // Do something return $content; } add_shortcode('my_shortcode','my_shortcode_function'); I wonder how to add ...
0
votes
0answers
111 views

function triggered by “manage_users_custom_column” filter not working

I am trying to add a custom column un users.php but it stays empty. I have successfully added a column to the users admin page with this code in my theme's functions.php file: function ...
1
vote
1answer
28 views

Is it possible to add a filter for the output of nav-menu items in admin?

I want to remove certain input fields on the admin screen for nav-menus for specific menu positions. I've used filters to filter front-end output but not for admin output. Is there a filter available ...
1
vote
0answers
31 views

Categories filtering in new post

I have a website with post types that have subtitles for movies. That files are on a specific custom post type using http://www.wpdownloadmanager.com/ pro. Because all custom type posts are movies ...
0
votes
1answer
28 views

Redirect after post deleted

On the single template, I am using a delete post link generated by the get_delete_post_link function. When I use the link to delete the post I am currently on, it adds a query string of ...
0
votes
0answers
13 views

Filter terms bases on multiple taxonomies - operator not in? [duplicate]

Building a function for filtered taxonomies. How to use 'operator' => 'NOT IN' or 'operator' => 'IN' inside the query to only show tax_query terms that are connected to all taxonomies instead of ...
0
votes
1answer
47 views

relation OR instead of AND - Filtered term ID's in loop

Question not related anymore.. First I tought about the relation OR/ AND for results, but I believe I should work with 'operator' => 'NOT IN'. I would like to query the results that meet multiple ...