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

learn more… | top users | synonyms (5)

0
votes
1answer
22 views

Which Filter Do I Use To Modify The Subject Of The Retrieve Password Notification Email?

I am looking for the filter that enables me to modify the subject of the "Retrieve Password" notification Email. If you know which filter to use, please let me know.
0
votes
0answers
45 views

Events filter using wpdb for queries

I'm a WordPress (PHP) developer, however I have not done a lot of complex MySQL queries. I am working on an events website and want to create filters: User should be able to filter events by the ...
0
votes
0answers
8 views

How to send default value with new parameter on 'add_filter' [duplicate]

I'm filtering the_content and want to pass a second parameter with the filter for context. My problem is, I don't know how to pass the default value, $content as well as my new parameter, ...
0
votes
1answer
43 views

How to modify specific parts of a post content in WordPress

I'm trying to insert some custom code in each post in Wordpress, provided that it complies wit certain conditions. My problem is that the content needs to be added in an specific location that is not ...
0
votes
1answer
28 views

Redefine function arguments before rendering

How to change args values before function output (filter default values before call) wp_function($arg1,$arg2 = false){code} change to wp_function($arg1,$arg2 = true){code} without php runkit!
0
votes
1answer
29 views

Add a class to post if it has been recently updated

I'm trying to add 'updated recently' after the post title. I've discovered some code which works but because of plugins and some theme coding it affects numerous instances of the_title that it ...
2
votes
2answers
61 views

How to make post and comment count unclickable with dashboard_glance_items hook

I have a multi author site and I have already used some hooks to stop them from viewing other author's posts and media. Now, in the Wordpress Dashboard in the "at a glance" section it shows them the ...
0
votes
1answer
30 views

wp.getPosts with status = 'trash' using node.js

I was wondering how to set the filter option for wp.getPosts. I want to get posts with a status of 'trash'. filter is currently blank, and returns all posts other than trash. I am using the xmlrpc ...
0
votes
1answer
32 views

Access post ID in “content_save_pre”

First time poster, pardon my mistakes. I am trying to use the content_save_pre filter to grab a URL in the first line of a post and save it into a custom meta, and also set the post format as a link. ...
0
votes
0answers
36 views

Filter WP_Query output before it is accessed (pre_get_posts)?

I have read Using pre_get_posts with WP_Query and I'm not sure where to go with it. I have a recent posts plugin which adds variables to WP_Query - one of which can be 'offset' posts. The problem is ...
0
votes
0answers
39 views

Update taxonomy term count after the post is published

I am trying to update the taxonomy term count after the post is published with the help of following function but its NOT WORKING, any help please... function update_count_on_publish( $post_id ) { ...
0
votes
1answer
40 views

How to add a class to Buddypress avatars in the Activity stream? [closed]

I'm in the process of trying to integrate bootstrap with Buddypress and am trying to add a class of "media-object" to Buddypress avatars. I could do this by mimicking the Bootstrap CSS, but in the ...
1
vote
1answer
25 views

Filter Posts from the Main Query

I want to conditionally merge a custom post type with my posts post type, based on a custom field. If the field's value is 1, then I want I need those custom posts to appear in the same loop as posts ...
1
vote
1answer
41 views

How do I add Bootstrap and LESS to my migrated WordPress site?

I'm migrating a website to WordPress - it uses both Bootstrap and LESS. I found a snippet online for enabling Bootstrap and the outputted CSS via functions.php: function theme_add_bootstrap() { ...
0
votes
1answer
39 views

How to stop the deduction in “wp_term_taxonomy” count, when the post is deleted?

In wordpress, the normal behavior is, when you delete a post, the system automatically performs a deduction of a post (-1) in wp_term_taxonomy table in count field from a taxonomy row which it belongs ...
0
votes
0answers
22 views

Creating a filter to modify links ending in .pdf

I'm trying to create a filter that checks for links that are to PDFs, and append the href attribute with something like /form?file=[path to pdf]. For example, starting with: <a ...
0
votes
1answer
23 views

Custom Permalinks and filters?

Ok, so I've added a custom permalink, which is mapping to my page fine. For some reaosn though the filters I've added aren't showing up. In the shortcode, they're just being returned as NULL. My code ...
0
votes
0answers
33 views

global wp_query returning wrong post vars

I am currently filtering the_posts to recreate wordPress' "sticky post" function for custom post types. I also have to make sure that the sticky post is attached to a certain taxonomy term that ...
1
vote
1answer
48 views

Removing user contact methods works from functions.php but not from a plugin

I'd like to remove user fields and I used this code: add_filter( 'user_contactmethods', 'newfields' ); function newfields( $user_contact ) { unset($user_contact['facebook']); ...
-1
votes
1answer
38 views

After adding filter to plugin's code, post's content doesn't display

After adding a filter to plugin's code, the post-template.php is not showing the post's content. This code in plugin's index file: add_filter('the_content','post_add_me'); function post_add_me(){ ...
1
vote
0answers
51 views

Remove / Hide Attachment Display Settings in Add Media popup / dialog

I would like to filter out the 'Alignment' and 'Link to' options for Inserting Images. Ideally with php in the functions.php file. Thanks!
0
votes
0answers
45 views

List all posts types in admin edit.php

I am trying to show a list of all posts types in the admin. For now i can only show a list of particular post type, for example: wp-admin/edit.php?post_type=video , but how can i show a list of all ...
0
votes
1answer
89 views

Exclude Custom Post Type from shared Custom Taxonomy

I have a few custom post types and two of them are sharing a custom taxonomy. Is there a way to list the terms of that taxonomy for only one of the custom post types? At the moment I can get a list ...
2
votes
1answer
87 views

Filter Media Library by author or post_parent

I am trying to filter the Media Library so only media items that are uploaded by the current user OR children of the post being edited are visible. I've had no problem doing it if the conditions are ...
0
votes
0answers
22 views

Autogenerated Title for Custom post type loses title when trashed/deleted

I am generating title for a custom post type using the following code. It takes the $fname, $mname, and $lname values and generates a title based on the post. This works fine for custom post creation ...
0
votes
2answers
50 views

add class to internal links in content

i want to add a class to all links inside of the_content, that point to other interal content, f.ex. other posts and pages. i want to do this automatically. dunno if the best practise would be, to ...
0
votes
1answer
44 views

using posts_where for meta data on pre_get_posts

Let's say you have some code which filters posts by using pre_get_posts e.g. add_action( 'pre_get_posts', 'be_exclude_category_from_blog' ); function be_exclude_category_from_blog( $query ) { ...
1
vote
0answers
540 views

How to set a custom path, for ajax image upload folder in admin?

I am coding my first Wordpress plugin that handles some data for a custom (shop-like) post type. It also has an image uploader within a metabox, where you simply drag in your images and it ...
1
vote
2answers
34 views

apply_filters/do_action tag characters limit

Does apply_filters/do_action $tag name have a characters limit? Can be any problems if the tag name is way too long? I ask this because I know that WP transients have a limit of 45 characters. FYI, ...
0
votes
0answers
420 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
19 views

Does auto_update_plugin Filter Work When Put In Theme's functions.php File

I wanted to know if the (auto_update_plugin) and the (auto_update_theme) filters work when put in theme's functions.php file instead of config.php file in WordPress core.
0
votes
0answers
34 views

remove_filter right way

What is the right way to remove filter in condition? method 1 public function update_loop($query) { global $wp; if(!$query->is_main_query() || $query->is_admin) return; ...
1
vote
2answers
93 views

Hook Into the_content Filter For JSON API Only

I'm trying to figure out a way to remove the shortcodes from my JSON output which I'm using the Wordpress JSON API for. I need to remove the shortcodes from the content before do_shortcode is applied ...
0
votes
0answers
32 views

Post where filter not working with Ajax

I am trying to add filter "add_filter('posts_where', 'location_multicity_where_changes_ajaxin'); " with ajax but it is not working. After i call this in functions.php via add action it ...
0
votes
1answer
82 views

Keep post format class with isotope filter

When I add isotope filtering for displaying posts, I lose the format class. WITHOUT isotope filtering: <article id="post-22" class="post-22 post type-post status-publish format-image hentry ...
0
votes
0answers
60 views

Add menu/submenu items programmatically

Newbie question here. I'm hoping to modify a menu programmatically and am having trouble figuring out the right way to do it. My site uses a membership plugin. Users pay to become members, and ...
2
votes
1answer
43 views

What's the best way to split admin-only functionality in the theme's functions.php file?

I am customising a Wordpress admin area and so far so good with a number of add_filter and add_action calls in my theme's functions.php file. But I'm a bit worried because all this code will be ...
0
votes
1answer
50 views

Filter and display a specific custom field value [closed]

I am developing a travel website for an agency. I'm trying to to make the user able to select an option like "Select your departure" and filter the loop with all the departures available for the ...
0
votes
1answer
24 views

Register users by e-mail

I want to use an email address instead of username to register and login my members. I've got the login part working using some of the code in this answer. Works fine but as expected wordpress still ...
0
votes
1answer
123 views

WordPress filter to hook into menu <li> items and add a custom attribute

I have a WordPress template (I'm using Foundation as a base and https://github.com/olefredrik/foundationpress/ as a starter theme) I'm trying to build and I can't seem to figure out how to hook into ...
0
votes
0answers
65 views

Custom the_content filter?

I have written a plugin which uses a WYSIWYG editor to output a custom success or error message that the user can specify. HTML is allowed within the WYSIWYG editor, and I have used the_content ...
0
votes
1answer
29 views

Hook into 'when user logs in' [persistent login]

I'm trying to create a persistent login mechanism in Wordpress (I can't find a plugin, but if there is one, let me know!). But I'm struggling to find a hook (add_action or add_filter) that runs when ...
0
votes
2answers
36 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
0answers
14 views

When adding media, can I filter the HTML generated from “Insert From URL” before it hits the editor?

function test_function( $html ) { return $html . 'TEST!'; } add_filter( 'post_thumbnail_html', 'test_function', 21 ); add_filter( 'image_send_to_editor', 'test_function', 21 ); add_filter( ...
0
votes
1answer
57 views

passing '&' in return function of add_filter

I have below line in my return function of add_filter in wordpress. add_filter('the_content', 'my_drama_func'); function my_drama_func () { return "function getthrough() { jQuery.ajax({ ...
0
votes
1answer
29 views

Surround uploaded image link with div

When you upload image you have smth like this <a href="http://vitya/wp-content/uploads/2014/06/8.jpg"> <img class="alignnone size-Small x Big wp-image-65" ...
0
votes
3answers
50 views

Once redirected by Rewrite rules, how can WordPress know the page?

I have been searching for some configurations of .htaccess, filters and hooks to make able to manage the inner site uri's. The goal was force login, register and admin pages through SSL, and all the ...
0
votes
0answers
11 views

How to change the structure of an image attachment in a post?

I'm trying to solve a problem with the attached images in a post. Somehow the structure is not working right on a theme i'm using. Instead of showing a div with the class "wp_attachment" is just a h6 ...
1
vote
1answer
85 views

Apply the_content filter, but prevent other hooked actions

I have a plugin that displays some content onto the front end of the site after applying the_content filter to the block of text. I do this for formatting and maintaining links and images etc. When I ...
0
votes
0answers
12 views

How to set “Unattached” option as default in Media Library?

When inserting an image into a post, I want the "Unattached" filter to be the default upon opening the media library. Screenshot Any way to do this?