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

learn more… | top users | synonyms (5)

1
vote
3answers
509 views

Change content before writing to database

I've searched around but I can't quite pin down the answer for this. I am attempting to use the content of a custom field as post_data and save it to the database as such when a post is created or ...
1
vote
1answer
216 views

Alter image output in content

I'm trying to implement the JAIL javascript into my WordPress install. The javascript requires me to add a data-attribute and change the output html of images. I have been looking through the codex ...
1
vote
2answers
2k views

wp_title() empty on a static front page

I'm trying to use wp_title() to create a heading for my pages, but I'm using a static front page and, while all of the other pages render the title properly, the front page won't. This is what I'm ...
1
vote
1answer
182 views

filter the_title problem in nav

Hi I have a problem with the_title filter: I have this code at my constructor: add_filter( 'the_title', array($this, 'change_title') ); and this as callback (for testing purposes) public ...
0
votes
1answer
42 views

How to enable visual editor when editing comments on the dashboard?

For editing a comment in admin pages the editor is only html, can we modify the edit comment page with a filter to include visual editor too?
0
votes
1answer
2k views

Apply the_content filter to a custom field with multiple values

I have a custom meta box set up that allows users to paste the Youtube URL of a video so that it can be embedded into a post/page. The meta box can be repeated so that a user can add as few or as ...
0
votes
2answers
2k views

Add_filter rel=“prettyphoto” to WP3.4.1

I know there have been a couple of questions in relation to this and had a look at them, but mine differs slightly on the problem experienced and the code. I am basically building my first theme and ...
0
votes
2answers
892 views

Conditional custom menu?

I'm trying to create a custom menu that displays a <li></li> when a user is logged in, and not display it when they're not. I have this so far, but it's not working. Does anyone know how ...
0
votes
1answer
538 views

display tag slug as class per link in tag cloud

I would like to filter wp_generate_tag_cloud so each of the tag links include the slug as a class. More specifically, I would like to output "tag-" + the tag slug. Currently what is assigned as the ...
0
votes
1answer
346 views

How to remove the RichText Meta Box

How can I remove the rich text box editor in WordPress? I have used the remove_meta_box function specifying the boxes ID, but it does not work like it does for other core meta boxes: The code I ...
0
votes
3answers
2k views

Ajax, filters and shortcodes

could you figure out why I'm unable to get shortcode filters applied in ajax inclusion of posts? Let me explain better: I've managed to include a post from within another post, through ...
5
votes
1answer
343 views

Limit Media Library to Given Folder

I have made a plugin that uses the Media Library to allow users to upload files to a specific directory - using the upload_dir filter. I would like to know if there is a way (i.e. a filter) I can use ...
5
votes
2answers
2k views

Earliest hook to reliably get $post/$posts

What's the earliest possible action I can hook into where I'll be able to access the global $post/$posts variables on both the front and back ends? I've tried looking through the Codex reference, Adam ...
4
votes
3answers
219 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 ...
3
votes
1answer
104 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 ...
3
votes
1answer
474 views

Hide custom image sizes from media library

I want to hide a few custom image sizes from the media uploader: The following code (posted here) works only for the default image sizes: function remove_image_sizes($sizes) { ...
3
votes
2answers
843 views

How To Determine If A Filter Is Called In A Sidebar/Widget Context?

So I have a plugin that appends or prepends an enhanced author biography to the content of a page/post/custom post type. It does this by hooking to either the_content or the_excerpt and ...
3
votes
3answers
3k views

How to hook wp_list_pages?

How can I hook the wp_list_pages function so that it reads a value of a custom field and displays it instead of displaying the page title?
3
votes
3answers
3k views

I'm using a filter to remove the <p> tags auto wrap, but there still wrapped elements?

I have this in my functions.php: The images inside the slider were added as custom post types called "Page Content." I'm not sure if the filter only applies to the main Posts. /** * Remove ...
2
votes
1answer
72 views

Am I using the right hook for removing quicktags on the admin TinyMCE?

This is more of an excercise than something for a client. Anyway, I'm trying to disable the quicktags when you're on the dashboard and you click on Comments > Edit Comment. On that screen, there's a ...
2
votes
2answers
2k views

Add placeholder attribute to comment form fields

I have been trying to add to the default WordPress comment form. I need to add placeholder="" to each field. I can't figure out the filter. I don't get any errors but I don't see the placeholder ...
2
votes
1answer
986 views

Custom search filter causes menu and query_posts problems

I'm using a custom search filter (using my custom query var type), like so: function fteh_pre_get_posts( $query ){ if( isset( $query->query_vars['type'] ) ) $types = explode( ',', ...
2
votes
1answer
690 views

How do I add a current class to the current post?

I have this list set up of the latest 7 posts: <ul id="post-list"> <?php global $post; $args = array( 'numberposts' => 7 ); ...
1
vote
1answer
128 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( ...
1
vote
1answer
58 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
1answer
130 views

What to use instead of the content_save_pre filter?

I read on Adam Brown's website that the content_save_pre filter is depreciated as of WordPress 3.8 - is this true? It doesn't say it on the official codex page for content_save_pre so I'm skeptical. ...
1
vote
2answers
46 views

Calling apply_filters on non-documented hooks

I have been trying to learn how to write plugins and I thought the best way would be to look at other plugins. I was taking a look at this one and the first lines /** * Plugin Name: Media Library ...
1
vote
2answers
214 views

How to trigger the core WPLANG to make automatically set a language when the theme is activated? [duplicate]

I'm developing a theme especially for Bānglā blog posting, and it'd be under GNU license. I questioned about a Calendar Widget translation with some problems today, and got a comment saying: I'm ...
1
vote
1answer
81 views

How to hook some Unicode texts into calendar widget safely?

I collected a good numerals replacing function for WordPress calendar: function make_bangla_number($str) { $engNumber = array('0','1','2','3','4','5','6','7','8','9'); $bangNumber = ...
1
vote
4answers
1k views

Filter specific shortcode output?

Is there a hook in WordPress that I can use to filter the output of a specific shortcode? Something like this: add_filter('shortcode_output', 'my_filter_function', 2); function my_filter_function ( ...
1
vote
1answer
153 views

Using ob_get_content to get_search_form puts into infinite loop

I am trying to change the look of my searchform. It basically needs to have two text fields. I want this to be in form of a plugin, which anyone can activate. SO obviously I do not have any control ...
1
vote
1answer
123 views

Remove class that has been added by parent theme

My parent theme generates the following class in body: style-cupcake. I don't want that. The best way to get rid of this is by adding my own functions in a functions.php file in my child theme, right? ...
1
vote
2answers
763 views

Adding schema itemprop image to the_post_thumbnail with filters

I have tried to apply filters to the_post_thumbnail() function using apply_filters( 'post_thumbnail_html', $html, $post_id, $post_thumbnail_id, $size, $attr ); Here's the code I have come up with ...
1
vote
1answer
607 views

posts_groupby problem

On my search page I want to group the posts by post type. To do this I've got the following: add_filter('posts_groupby', 'group_by_post_type' ); function group_by_post_type( $groupby ) { global ...
1
vote
2answers
110 views

Failed to invoke other hook from the init hook

Related to this question (Use wp init hook to call other hooks?) but not the same. Sometimes, I found that the hook will failed to run when I place inside the init hook, e.g. Not Work: ...
1
vote
1answer
3k views

Setting title using wp_title filter

I want to do something very simple but I'm stuck finding where in WordPress I need to perform this. When someone on my WordPress site visits a blog post page I want the title in the blog post to ...
1
vote
1answer
159 views

Post Specific Uploader

I have played around with filters for uploading files. The closest I have gotten is to have the files uploaded to the directory, but after the file uploads, I get a series of errors: Undefined index: ...
1
vote
1answer
3k views

How to filter 'post_gallery' after all other filters/plugins etc

I'm trying to re-format the gallery output a bit, change default columns and link setting, as well as exclude the featured image from the gallery images. I can use *add_filter('post_gallery' ...)* in ...
1
vote
1answer
807 views

Wordpress Search Filter Only for Page with Child of Child of Child of Child of Child

after browsing question from this site I found the workaround for this: function SearchFilter($query) { if ($query->is_search) { global $post; $query->set( 'post_parent', 21 ...
1
vote
2answers
2k views

Default or Preset Content for Custom Post Types

I am trying to modify the code for default content to display based on post type, but so far I have been unsuccesful. The base code is: add_filter( 'default_content', 'my_editor_content' ); ...
1
vote
1answer
500 views

Can't filter wp_get_attachment_link

Can't figure out why this won't work: function my_get_attachment_link($html){ $postid = get_the_ID(); $html = str_replace('<a','<a rel="shadowbox['.$postid.']"',$html); return ...
1
vote
2answers
232 views

Widget Area: Modify $param['xy'] from widget-$n

I have different widget areas. One is a horizontal area that may contain eg. 4 widgets next to each other. My Question is how would i add a different eg. $param['widget_title'] to widget number $n ...
1
vote
2answers
773 views

Help with issues on “Adding a Taxonomy Filter to Admin List for a Custom Post Type?”

This question relates to a solution found here from user somatic and mikeSchinkel I am testing somatic's solution, and it loads and populates the dropdown with no issues, but When you click filter, ...
1
vote
2answers
814 views

How to apply content filter permanently?

I have the following temporary filter to fix a content error. We have data in our posts that have 4 digit zip codes, because the leading zero was cut when the original file was created. (For instance, ...
0
votes
0answers
92 views

Multiple Ajax Data Action

From this tutorial, how to create multiple data on ajax action in the code below? <script> function term_ajax_get(termID) { jQuery("a.ajax").removeClass("current"); ...
0
votes
0answers
155 views

Multiple AJAX filter posts on click based on category

I tried this tutorial. I'm having problems. Can this be implemented in two filters with the same kategory? I mean, I want to separate the products popular and latest products. But the same category. ...
0
votes
1answer
195 views

How to change/rewrite the lost password url?

I used iThemes Security (formerly Better WP Security) hide back-end functionality to change the login url to /signin however clicking the lost password link /wp-login.php?action=lostpassword now ...
0
votes
1answer
827 views

AJAX filter posts on click based on category

This is my first foray into AJAX, I've been splicing bits of code from various tutorials which probably hasn't helped. I have a list of categories on my homepage (index.php) and a list of the most ...
0
votes
2answers
44 views

Retrive images from the_content()

I would like to get the images from the_content(), I know I could use a regex to get the images but I wanted to know if there is any other more 'wordpress way' for doing this? I have this within a ...
0
votes
1answer
27 views

Filtering more than one term in a taxonomy in WP

i have a custom post type called 'events', it has a taxonomy named 'category' structured this way: hotels (parent) -1 star (child) -2 stars (child) -3 stars (child) location (parent) ...