Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

0
votes
1answer
34 views

Adding bootstrap classes to video shortcodes

I want to make videos responsive... There is a function in /wp-includes/media.php file: line 2497: $html_atts = array( 'class' => apply_filters( 'wp_video_shortcode_class', 'wp-video-...
1
vote
1answer
31 views

Which hook is fired when inserting media into a post

I want to add numbering to each image when I insert them into the post. For example if I insert 3 images into a post, there will be: Image 1 Image 2 Image 3 I looked through the WordPress ...
0
votes
0answers
19 views

Run javascript code after “woocommerce_payment_complete” action hook

I am trying to fire custom javascript code after successful payment in woocommerce. Code that I use so far: add_action( 'woocommerce_payment_complete','mysite_woocommerce_payment_complete' ); ...
1
vote
1answer
19 views

Executing `createimagefrompng()` from save_post hook (or equivalent hook)

I'm having trouble executing createimagefrompng() from a hook. I've used the fairly straightforward PHP way to add a watermark to an image. If I hardcode the image URLs in this function and for ...
0
votes
0answers
19 views

How to cancel the trash action inside wp_trash_post

I need to restrict the button "EMPTY TRASH" and make it delete only the posts only if the logged in user is the creator. I tried to use the wp_trash_post and i need to decide in the function if i ...
0
votes
0answers
28 views

I want to add values ​of a function in all posts in a particular category

I want to add values ​​of a function in all posts in a particular category, I get exactly what I want, but not the old problem appears in post_content(edit mode em dashboard) add_filter('the_content',...
0
votes
1answer
109 views

Woocommerce change shipping method by hook

What I would like to do is to have a condition to pick which shipping method is used. For orders with total cost < 100 the shipping method should be 'regular' and for orders with total cost > 100 ...
3
votes
1answer
50 views

Remove action from plugin on other plugin

I'm trying to remove two of the actions that adds a plugin (sportspress specifically). The actions of this plugins are: add_action('sportspress_before_single_player','...
1
vote
1answer
35 views

Order of Operation for these three hooks

What is the order of firing for these three hooks? add_filter( 'comments_array', array( $this, 'BuildCommentsArray' ), 10, 2 ); add_action( 'preprocess_comment', array( $this, 'write' ), 10, ...
0
votes
0answers
12 views

Check If WooCommerce Product Downloadable From Edit Screen

I'm creating a plugin for WooCommerce and I want the metabox to show only when the "downloadable" checkbox is clicked. Are there any conditionals for this when dealing with the edit page of the ...
1
vote
3answers
142 views

Menu item added in wp_nav_menu_items filter is never highlighted

In a Twenty Thirteen child theme I append a menu item (a link to /player-number page template, where the number is different for each user and represents her or his id in a game database) using the ...
0
votes
2answers
81 views

Hook triggered twice in a Woocommerce single product page

I am trying to develop a plugin to extend WooCommerce and I would like to do something with the product id when I land on a single product page (e.g. store it in the database or store it in a session ...
0
votes
0answers
27 views

pre_get_comments or the_content filter

I am learning wordpress deveplopment. I have a litle problem for understand how to use the right hook for add my code. In this case I have to ask... what is the best practice for show social icons ...
0
votes
1answer
21 views

'Conflict' with action deleted_post and is_admin()

I created a delete button on frontend for blog posts and custom type posts and I would redirect to a specific page after deleting them, I looked around on google and I found all solutions like this: ...
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
0answers
17 views

Is There a Hook To Override a Category Page?

I have a few custom category taxonomys. I have custom meta values setup for all of these including a featured image. Is there a hook i can use to alter the content of the page in order to display this ...
0
votes
0answers
53 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" src="/wp-content/themes/tna-...
0
votes
0answers
39 views

Remove taxonomy from wp_title_rss

I have a custom post type called "Episode" with a custom taxonomy called "Podcast" that i would like to change the RSS title for. Currently when looking at the rss feed for a specific episode it ...
0
votes
0answers
35 views

comment visible only for author post and admin and user comment

i have a custom post called "service" in this custom post i want a possibility to send proposal-comment by user. but i want this comment are visible only for admin + author of post + user that send ...
0
votes
1answer
57 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
2answers
65 views

Creating alternate meta box context locations

I am trying to create two additional add_meta_box context locations ('after_title' and 'after_editor') within posts. This doesn't appear to do what I think it should. The meta box does appear on the ...
0
votes
3answers
94 views

How to change the location of admin notice in html without using Javascript?

I am adding an admin notice via the conventional admin_notice hook in my plugin: function my_admin_notice() { ?> <div class="notice notice-info is-dismissible"> <p><?php ...
1
vote
1answer
91 views

Wordpress hook that gets featured image from direct URL?

I use a lot of plugins on my site so I'm trying to minimize the amount more plugins. I was wondering if there's a wordpress hook I can use so that I can use an image that is hosted on imageshack and ...
0
votes
0answers
44 views

How do I output the returned value of a function that uses an earlier hook?

If I define a function that retrieves a value within an action hook and returns it, what is the best way to call the function in a later hook? My general aim is to write reusable functions with ...
0
votes
1answer
47 views

Custom button on custom taxonomy listing page

I want to have a custom button at custom taxonomy listing page. Please see the screenshot, I need a button so that I can export all my terms. I am not able to find any hook to do something like ...
5
votes
2answers
58 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): ...
0
votes
1answer
42 views

Why the post ID is 0 in a hook within wp_insert_post_data?

I am having trouble getting the ID of the post in a function applied to the wp_insert_post_data filter. It is actually zero. To clarify I am getting the $postarr and the value of the ID field is 0. (...
1
vote
1answer
41 views

WooCommerce add_action hook results in 500 error

I am trying to add a line of text on the checkout page of the store that will go immediately after shipping row. I added the following to my child theme functions.php file: add_action( '...
0
votes
1answer
36 views

How can I add an extra WooCommerce hook

In the standard WooCommerce template file content-single-product.php there is a set of hooks that control the way the page lays out in a series of blocks which are called by a series of hooks eg '...
0
votes
2answers
41 views

How to cancel an action hooked to untrash_post? or any hook

I want to do the following in a plugin: - hook to untrash_postwith a custom function - do some checking inside custom function - cancel actual post restoring (untrashing) I've tried with ...
0
votes
0answers
51 views

Add tab to profile.php wordpress plugin development

I already know how to add an extra field in user profile. But in my case I have A lot of field to add and It is good practice that your form is not too long. So I decided to implement tab panel in the ...
1
vote
0answers
161 views

Can't get wp_title filter working in twenty sixteen child theme

I am having difficulty overriding the title set in the admin panel for a custom template page, and outputting a custom <title> tag. The parent theme is WordPress's stock Twentysixteen, which ...
0
votes
2answers
68 views

Template filter for custom taxonomy terms

I want to replace custom taxonomy term template with my custom template. Like using add_filter('single_template','customFun'); replaces single custom post type template. I have a custom taxonomy e.g ...
0
votes
1answer
43 views

wp_editor customization

I've been stuck in a simple issue for the last couple of hours: I'm developing a website in which I use several wp_editor instances, all with custom buttons and styles. This is very simple to achieve ...
0
votes
1answer
91 views

Send admin to a different login than users?

I have created a separate login page on /login/ and have wp-login.php redirecting there as well - I have also hooked into a few WP login related hooks such as wp_login_failed so that people get ...
0
votes
0answers
22 views

Where i need to hook in order to catch view,edit,create user actions and encrypt / decrypt accordingly?

I need to be able to encrypt / decrypt CPT fields automatically. This means that i need to decrypt the content automatically when i user views or tries to edit a CPT and also i need to encrypt when ...
0
votes
0answers
8 views

Adding hook when post is submitted [duplicate]

i made a custom taxonomy named project and i wanted to add a validation during the submission of post. I want to check if the post has selected any terms under the project taxonomy. what can i do to ...
0
votes
0answers
18 views

How do I redefine wm_navigation() or wp_logo() within a theme that uses hooks?

What I want to do: Move the title of my website from it's current location to be in the "menu" div so that it is to the left of the menu/page list. Demo page: http://aaronmoore.me/visartsassignments/ ...
3
votes
2answers
184 views

Hook *after* user password change?

I know that password_reset hooks: Runs after the user submits a new password during password reset but before the new password is actually set. but there is a similar hook AFTER the new password ...
1
vote
0answers
97 views

How to find the hook(s) that make site slow

I am working on a site and it is working fine except one thing that it is very slow. I tried to figure out that which plugin or theme is creating the problem and find out that woocommerce-subscription ...
1
vote
2answers
89 views

wp_enqueue_scripts not called on search page?

I've written a custom theme. It's pretty complex so I won't post a huge code block here for everyone's sanity. In my functions.php file I have the following hook being called: function ...
0
votes
1answer
31 views

WordPress Register Style Called Incorrectly

Why am I getting this error? Notice: wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or ...
1
vote
0answers
47 views

Where to add hooks in a class

In the code below, shouldn't the hooks under the bottom two functions be placed inside the constructor? class The_Class { private static $instance = null; public static function ...
1
vote
1answer
56 views

Modify custom field input data before creating a new post

I'm try to check input data before it is added to DB. For example: I have a custom post meta named book_isbn in post page. I want to make sure that this variable $_POST['book_isbn'] is valid before ...
0
votes
0answers
25 views

Bake-in TinyMCE Advanced into theme?

Looking to bake-in the TinyMCE Advanced editor into my theme automatically without using the plugin. Can this be done or is this outside of the scope of what a hook can do within WordPress? I have no ...
1
vote
3answers
148 views

On which hook should I be calling register_nav_menu(s)?

I've variously seen register_nav_menus() called: on after_setup_theme on init pasted "loose" into functions.php with no apparent change in functionality. Which hook should I be using to call this ...
1
vote
0answers
68 views

How to Add Class or ID to a WooCommerce Layered Nav Widget

I'm looking to modify the class/id of a WooCommerce Layered Nav widget by adding in a new class or ID if the widget is displaying for a WooCommerce attribute (ex. Sizes, Colors attribute). Is there ...
1
vote
0answers
44 views

Is it possible to delay execution of shortcode output callback?

I have a problem : shortcode output callback triggered too early. /* Defined in plugin constructor */ add_shortcode( 'foobar' , array($this,'pre_render_routine')); function ...
7
votes
1answer
217 views

What is the difference between update_post_meta and update_postmeta hooks?

I am working on an enhanced revisioning system, to create a log file for all changes made by users and/or algorithms concerning metadata attached to specific post types. While I am perfectly aware ...
0
votes
0answers
25 views

Hooking to APIs working on WP_Posts

I'm working on a WP site, and I've found a plugin that I can use to do most of the work. But there is a problem: as I feared, it stores all of its data inside WP_Post. This is obviously pretty stupid ...