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

learn more… | top users | synonyms (5)

0
votes
1answer
42 views

Move a file from a directory to another

I have this function: function attachment_selectbox_edit($form_fields, $post) { $select_options = array( "no" => "No", "yes" => "Yes" ); // get the current value of our custom field ...
3
votes
1answer
35 views

Keep Users Logged In As Long As I Like

I'm implementing a Kiosk webapp based off WordPress and I have some conditionals which are key, they work based on whether user is logged in or not. I'm aware that after user clicks "remember me" it ...
0
votes
0answers
22 views

How do I change the link class in paginate_links() [duplicate]

I am trying to change the link classes output by paginate_links() from prev page-numbers and next page-numbers to previous page-numbers and next page-numbers to align with our framework. I'm not quite ...
1
vote
0answers
32 views

Filter to shorten column content on edit-tags.php

I am trying to get the content of columns in the edit-tags.php page. I have been trying to do it, first I tried to get the columns. add_filter( 'manage_posts_columns', 'get_columns'); function ...
1
vote
1answer
28 views

Multiple filters for wp_get_archive

I need to display custom posts archives on a page in the following format: Monthly - Grouped by Month for the Current Year. Annually - Grouped by Year & Month for all previous years So I have ...
1
vote
1answer
17 views

how to disable default menu classes

i want to disable default menu class, bellow code is disable menu class completely. add_theme_support( 'menus' ); add_filter('nav_menu_css_class', 'my_css_attributes_filter', 10, 1); ...
0
votes
1answer
24 views

Hide a specific post from Archive Feed

I want to remove a custom post type post from it's archive feed only. But keep in the main feed. Like is I have 1) main feed: myexample/feed 2) Custom post type Archive Feed: ...
0
votes
0answers
20 views

Filtering title in BuddyPress

I'm working on filtering titles for BuddyPress pages (specifically, Groups and Group Forums). I'm having some trouble so maybe someone can point me in the right direction Since 4.1, WordPress has ...
0
votes
2answers
51 views

Filter and validate user role in registration

I want to show a select box for user roles in the registration form. I am using this model: /* ROLES IN LIST REGISTRATION */ // 1. Add a new form element... add_action( 'register_form', ...
0
votes
1answer
30 views

Highlight a Post on archive page if it has a new comment?

I have been searching for a solution to highlight a post if it has a new comment but there is no plugin/forum answer about this. Basically I have a custom post type listings on a page. I want to add ...
0
votes
0answers
16 views

Adding Taxonomies Dynamically and Removing Unwanted One

My overall goal is to create taxonomies dynamically in the admin, then use those to filter results on the frontend. I have an options page setup with ACF with a repeater inside that I use to create ...
1
vote
1answer
54 views

How to add #navbar to all page links?

I have several Wordpress websites with large images at their tops, using 2013 child theme. How to add #navbar anchor to all page links, so that the browser scrolls down a bit, when a user clicks a ...
0
votes
1answer
41 views

How to attach post ID to image links in Wordpress tinymce editor

I'm trying to output the post ID in the rel-attribute of the image links that are generated by WordPress when using the Add Media button. I found a way to retrieve the post id and also how to ...
1
vote
1answer
21 views

Add Sortable Column For All Post Types

I am creating a hit counter that counts the number of page views across all post types. I have gotten it to work and the column displays for each post type showing the total number of page views. I ...
0
votes
1answer
17 views

Use has_filter on comment_post

I hook to comment form (on comment_form_logged_in_after if user is logged in and comment_form_before_fields if not) to add 2 fields (rating and title). These fields can be mandatory or comment will ...
0
votes
1answer
128 views

Creating dynamic filtering on custom post type

My overall goal is to have a custom post type and on the archive page have several different filters in the sidebar, like on a lot of ecom sites. I think this would normally be done in Wordpress ...
0
votes
1answer
26 views

Search and Replace Script Loader in Head Only Works in Footer

I've got a function that uses script_loader_tag filter to search and replace adding asynch="asynch" attribute. It works. I don't want this doing anything in the footer, but rather the header alone. ...
0
votes
0answers
37 views

image_send_to_editor filter

I'm trying to achieve the code below, when using the normal default editor in wordpress. <div class="col-md-6"> <figure> <img class="alignright" ...
7
votes
3answers
237 views

How to add headers to outgoing email?

I want to add an additional header to outgoing emails on my sites, so I can easily determine which site sent a given email. (I put a standard functionality plugin on all of my sites, so this is easy ...
1
vote
1answer
41 views

Wordpress php filter admin_body_class not working

I have the following function in a plugin I have built: static function filter_add_body_classes( $body_classes ) { $new_classes = array(); // Only when logged in if ( ! ...
0
votes
0answers
31 views

A way to increase image hard crop quality?

WordPress hard crops images when uploaded. I placed this code snippet in functions.php to make sure there is no image compression/quality loss on image upload and it worked great: add_filter( ...
0
votes
1answer
34 views

How to change Woocommerce breadcrumbs content?

I want to customize the breadcrumbs directly from PHP. Some of the pages are generated dynamically and do not exist in the database, therefore i must automatically put them in the breadcrumbs with ...
0
votes
0answers
35 views

Filter a plugin class method

I'm using plugin and am trying to hook into one of it's filters although am having difficulty. The following method: /** /* ...
0
votes
0answers
31 views

WP_Query order by number of likes

I'm trying to configure WP_Query to order by number of likes. I have a custom table called 'likes', which records which liker (user ID) likes which post: id | liker | post_id 1 | 11 | 120 2 ...
0
votes
0answers
65 views

add attachment-filters on custom modal-media insert

how can I do to have the attachment-filters menu in my upload window? my upload wordpress deafult upload console.log("enqueque on metabox.php - media3.js"); openMedia = { data: false, v: ...
0
votes
1answer
23 views

Post filter Month dropdown at front-end like wordpress backend

when i run the following code. $args = array( 'type' => 'monthly', 'limit' => '', 'format' => 'option', 'before' => '', 'after' ...
0
votes
1answer
19 views

Can I remove or edit an include() from a function with a filter?

I need to edit the output of a plugin and the part I need to change is actually a html file that is brought in using include(name-of-file.html). The function has a filter, but I am just now beginning ...
0
votes
2answers
88 views

Filter posts by author and category simultaneously

I'd like to include in my website a feature for users to only see posts from a certain author and a certain category. I'm able to do it separately but I can't seem to understand how to do it ...
0
votes
1answer
34 views

Password protected Page add_filter to change the text doesn't work

I search a solution to change the text on my protected page: This post is password protected. To view it please enter your password below: I've found this filter hook and I included it into my ...
0
votes
1answer
49 views

Show different pages on site depending on user choice

I am building now a Wordpress site that has a automatic opened popup on the first page which gives the users the possibility to choose between 2 options (ex if they are private customers or company ...
1
vote
1answer
90 views

Adding a Clone link to product attributes - post_row_actions() filter, or how to override a Class question

I have a request to be able to duplicate a product attribute in WooCommerce. Think: duplicating a product (with already existing functionality), or plugins that allow you to duplicate a post. ...
0
votes
0answers
14 views

woocommerce recent products without certain category

I'm using WooCommerce and MyStile (Theme) Let's consider that I have following categories: Fruits Cars Electronic Software Now on my homepage I want to show the new Products, but only of the ...
0
votes
0answers
26 views

WP_Query pulling all content even with readmore

I'm using a plugin called quicksand that is working for the most part. It hasn't been updated in 2 years though so support there isn't an option. I just noticed though that even though I'm putting a ...
1
vote
2answers
33 views

Passing variable from child theme to parent theme

I want to pass my google map custom colors from my child theme to my parent theme. So in my Parent Theme's functions.php I have add_filter( 'post_thumbnail_html', "map_thumbnail" ); function ...
1
vote
1answer
38 views

how to remove dash (-) post status from post title on posts listing page wordpress

I want to remove post status from post title. E.g Currently on listing page post title comes like "Hello World - Draft" or "ABC - Completed" I don't want - Draft or any other post status. Note* : I ...
0
votes
2answers
35 views

Passing variable from child theme function to parent theme filter

I want to pass a variable from my child theme function to a filter which resides in my parent theme. Please let me know whether below code will work or not ? Is it the right way ? Code in Parent ...
3
votes
1answer
40 views

Some nav-menu filters do nothing

So, I've been trying to write a plugin, and I need to use the 'nav_menu_link_attributes' filter. I tried adding the filter, but it didn't respond - at all. That is, I made it die mid-process once the ...
0
votes
1answer
32 views

Hook in parent theme Menu function

Trying to modify Parent Menus function on child theme, the original function is: function original_theme_menus() { $menus = array( 'top' => __( 'Top Menu', 'theme-domain' ), ...
0
votes
2answers
39 views

Change post title if post has specific category

Basically what I am trying to achieve is to have title changed of posts which are in category number 30. My code is: function adddd($title) { if(has_category('30',$post->ID)){ $title = 'Prefix ...
5
votes
2answers
54 views

What hook do I use to edit the post statuses option in admin?

I want to restrict pending posts to only certain users in the admin section, so I want to remove it from the post status options when viewing all posts (the bit highlighted in red in the image below): ...
1
vote
1answer
103 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
1answer
12 views

Access or edit custom generated permalinks with WP_Rewrite

I want to create custom permalinks for my plugin using WP_Rewrite. I found the codex the have great examples and this stack topic also explained a lot to me. Currently I've got the following code ...
0
votes
1answer
44 views

How to check if “is single” page

I know – at first glance the problem may seem easy to solve – and I hope it is – I just can't figure out where/ how to check if I'm really on a single page, or just rendering a single page in the ...
0
votes
1answer
33 views

Regex works in regexr, but not if I filter content [closed]

I want to filter the content of everypost and add classes to my links depending on certain conditions. At the moment I just want to filter all href attributes from the content and change them. ...
0
votes
4answers
120 views

How to prepend to the_title for admin-side plugin's use

When I do this: function append_album_review_to_title( $title ) { global $post; if ( get_post_type( $post->ID ) == 'album_review' && in_the_loop() ){ return 'Album Review: ...
0
votes
1answer
55 views

Apply the_title filter to post titles AND backend auto social-sharing plugin, but not nav menu

The Challenge I have been trying to write a filter that applies (prepends a string) to (a) post titles of a certain post type and (b) to that same post type WordPress admin backend for use by an auto ...
0
votes
1answer
15 views

Filter authors on meta value

I have added a section to my user profiles called ArtistCategory. This can be value X or Z. I'm using the code below to get a list, which I use in a menu and show after the artists display_name the ...
4
votes
3answers
190 views

Remove description from <title> on Home

My theme has support for title-tag add_theme_support('title-tag'), but I can't remove the wordpress description bloginfo('description') from <title> on Home page. I'm trying using this filter ...
0
votes
1answer
26 views

Is it possible to completely replace a post with an action/filter?

Currently I am trying to replace the $post global with another dynamically loaded post in the wp action. However, while even in the templates the correct post data shows when outputting $post, the ...
0
votes
0answers
27 views

How to remove CPT comment feed from head?

In a custom post type I have set has_archive to false. In the head of a CPT page however I still find a link to a feed like this: <link … title="Page Title | Comments Feed" ...