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

learn more… | top users | synonyms (5)

0
votes
0answers
16 views

Wordpress Apply filter in plugin causes 500 internal error

I use the plugin https://wordpress.org/plugins/show-post-in-lightbox/ to display all feautered image of every post on a page. whenver one of these images get clicked on a lightbox will appear showing ...
-2
votes
0answers
9 views

Apply Element to Filtered ACF Value [on hold]

I'm trying to place an element (corner ribbon) on certain term images in my archive. I'm using Advanced Custom Fields to assign a value to certain terms. The code below however places a ribbon on ...
1
vote
1answer
32 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( ...
0
votes
1answer
23 views

How to modify only part of a function through the filter

I'm trying to edit part a function that validates user registration and I need to change the language of the error response because I modified sanitize_user() to disallow "@" and ".". So I need to ...
1
vote
0answers
14 views

Create Search Form to Filter Through Terms

I have pages that displays a list / grid view of all my taxonomy terms. Over 200 terms. The page is paginated since there are so many terms, however, I would also like to include a "search" box at the ...
0
votes
0answers
12 views

Display Next page button before related post plugin

I am trying to set wp_link_pages to top in my related post. i am using related post plugin by zamantaplugin by zamanta pages link display after related post. but i want its show before related post ...
1
vote
1answer
29 views

Is it acceptable to treat a filter like an action?

The wp_insert_attachment_data filter is available inside wp_insert_attachment(). It allows attachment post data to be filtered before it is updated in or added to the database. $data = apply_filters( ...
0
votes
1answer
24 views

Removing URL and adding container around image in the featured image metabox

I want to remove the url and add a container(div) around the image in the featured image metabox. Wordpress output <p class="hide-if-no-js"> <a title="Set featured image" href="URL" ...
0
votes
0answers
15 views

Custom xmlrpc request does not pass parameters?

Here is what I have: function xmlrpc_login($args){ //this code actually runs var_dump($args); // is NULL ...other logic that needs the args values... } function ...
0
votes
0answers
19 views

Wordpress gallery shortcode - include author's images

I'm using the built-in wordpress gallery shortcode to display all images of a category -- documentation found here: Wordpress Gallery Shortcode Codex --- By using [gallery category="1"] How could ...
0
votes
0answers
17 views

add_filter not adding the filter

i am adding a filter at the end of my themes functions.php if( !function_exists( 'mars_widget_post_ids' ) ){ /** * @param array $query * @param string $widget_id */ function ...
0
votes
1answer
18 views

Add rel to all images in a post

I want to add a rel to all images in a post. I am trying following filter but it will wrap only the images which are in the gallery. It does not wrap the images which are added individually without ...
0
votes
1answer
25 views

How to add a filter conditionally based on page related Conditional Tags

I am developing a WordPress plugin and can't conditionally add filters based on the conditional tags. This is my code: add_Action('init', 'determine_location'); function determine_location() { $d = ...
0
votes
1answer
27 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) { ...
0
votes
0answers
11 views

attachment custom values are'nt inserted to database

I have created attachment custom field. After I uploading image and inserting to new-post.php (post creating window) no meta values are saved in database. Even that I have set a default value for ...
0
votes
0answers
10 views

Modifying Search to Exclude results from within short code or HTML

I've been struggling with this one for some time and I was wondering if anyone has any ideas on how to fix this. I'm not asking about stripping out short codes or HTML from the excerpt, that's fairly ...
0
votes
0answers
9 views

Show post categories names using apply_filters

I'm trying to change a plugin for each post show his categories names. The plugin use apply_filters to show post name. But how can I show categories names? $output .= $indent . '<li ...
2
votes
1answer
88 views

How to filter the description of a custom post type

I understand that although not used by core in any way you can set a description for a CPT: $args = array( [...] 'description' => "My CPT description" [...] ); register_post_type( ...
0
votes
1answer
19 views

Adding to an array & passing it through do_action/apply_filters

For exercise I am working through a PHP class to add meta boxes I found on GitHub. I just copied the code and now I am playing around with it to understand it. It works like this: The file ...
0
votes
2answers
35 views

How to apply the “retrieve_password_message” filter?

I would like to change the body of the password reset email that WP sends out with something more friendly. I am trying to use the "retrieve_password_message" filter but I am messing it up. Can ...
0
votes
1answer
66 views

query post limits

function posts_limit_fn($limit, $query, $custom_limit = ''){ if($custom_limit !== ''){ return $custom_limit; } return $limit; } this piece of code is executed into an AJAX ...
0
votes
0answers
8 views

Dynamically display custom posts by custom fields

I am an intermediate PHP/jQuery developer and would just need a few pointers in the right direction (a tutorial would be great!) please; I have a custom post type of "Events" - amongst others, each ...
1
vote
1answer
72 views

Which built-in Wordpress files are safe to edit?

I begin to work with Wordpress, I'm developing a theme with many functionnalities into it, and I'm good with that. My question does not have to do with theme development, but more with general ...
0
votes
1answer
18 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
38 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
39 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
27 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
28 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
48 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
23 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
23 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
23 views

Stop a specific plugin from executing based on product id in cart

I am trying to stop a specific plugin from executing based on product id in cart. However i can't seem to get it running. There are a few places where i want the plugin to stop inserting its function. ...
0
votes
0answers
28 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
20 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
28 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
22 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
33 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
33 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
14 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
20 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
29 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
32 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
28 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
39 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
31 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
76 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
47 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
17 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
36 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 ...