Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

0
votes
1answer
35 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
52 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
82 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
77 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
42 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
38 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
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): ...
0
votes
1answer
41 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
33 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
30 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
32 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
47 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
124 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
59 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
37 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
74 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
17 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
131 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
76 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
88 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
28 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
54 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
21 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
136 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
56 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
40 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
210 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
23 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 ...
1
vote
2answers
77 views

new WP_Query() - what is the earliest valid hook?

Specifically, is it valid to run a new WP_Query() during the plugins_loaded action?
1
vote
2answers
115 views

Change size and crop medium_large images

I use events manager pro plugin to show an eventslist. These event-list is showing their thumbnail image in the new (wordpress 4.4) wordpress image size "medium_large" (width 768px). I need an image ...
2
votes
1answer
82 views

Check if page parent has certain template

I want to check if a page has a parent with a certain page template attached to it. If I know that I can determine which scripts to load or not. Normally I would just get the page template and if it ...
1
vote
0answers
20 views

How to update the values when the featured image has changed?

I'm trying to implement this function. It saves in the database the dominant color of the image uploaded as featured image in a post. It's working perfectly BUT the problem is that it only works when ...
1
vote
2answers
29 views

schedule event in class oriented plugin

Actions usually support the following (if you are creating your plugin using a class based approach): add_action('admin_notices', array(&$this, 'emailNoticeGUI')); The wp_schedule_event does ...
1
vote
1answer
33 views

Plugins rewrite rules the right way

I need to create rewrite rules for my plugin. This plugin will be running on a very large WordPress Network (+2000 sites) so performance is important. Most tutorials and the codex recommend to ...
3
votes
0answers
44 views

Global Objects and Public Methods

I'm developing a plugin and am just thinking over best practices. How common is it to have a global object? Currently on plugins_loaded I am creating a global object of my class: add_action( ...
1
vote
2answers
42 views

Disable delete user

My site has custom post type 'Portfolio'. If a user has at least one Portfolio, how can I disable the option to delete that user? I found the action/hook delete_user, but it doesn't seem right for ...
2
votes
1answer
31 views

how to change link of some wordpress pages

I've made templates for the pages of my wordpress site such as: singup,signin,suggestions. Default wordpress pages link is as follows: doamin.com/signup/ or doamin.com/signin/ or ...
1
vote
2answers
55 views

Custom plugin: Trying to show saved data on frontend

I'm working on my first plugin and I have made a nice settings page which saves and works. But I have split it to few files and now I can't determine if field is checked.. I have also tried ...
1
vote
0answers
175 views

Importing Product Variation Images Swatches

I want to upload several thousand variable products to Woocommerce using the WP All Import plugin. I also want to display product variations using the Color or Image Variations Swatches plugin, which ...
1
vote
1answer
32 views

Footer disappears when using the_content ( )

I have an issue when using the_content() -- the footer of the page disappears and no errors are displayed. When I change the_content() to get_the_content() and echo this results then it works fine. ...
1
vote
0answers
15 views

wp_insert_post_data hook should be called before updating db but isn't

function custom_editing_permissions($data, $postarr) { //Post gets updated here WTF? die; } //Hook should be called "prior to inserting into or updating the database" ...
2
votes
2answers
99 views

How to set a custom post type post as static front page?

I am writing my custom theme from scratch and I have a custom post type 'my_frontpage' and want to declare one of it's posts as front-page. I want to do this via admin, hence simply add my cpt to the ...
1
vote
1answer
249 views

Remove Woocommerce product link

I'd like to remove the link from the Woocommerce product listings. I don't need the user to see the product detail pages, we are going to use Quick View instead. Anywho, I have been searching and ...
0
votes
0answers
9 views

Save to boolean custom field when video is embedded in post

For my site I want my visitors to be able to tick a checkbox to only include content (posts/pages) with video embeds in a search query. This would be possible if I stored the state (true/false) in a ...
1
vote
0answers
57 views

Audio Player not loading when the content is loaded through Ajax, MediaElement.js no applied

When I load the content using ajax it doesn't apply MediaElements.js to my audio player, so the audio isn't display. I think this is because the MediaElement.js is loaded with wp-footer(), and this ...
1
vote
1answer
57 views

How to add theme support?

I figured this would have been a question already, but I haven't come across it. I'm wondering what the correct hook for checking theme support is in a theme and also a plugin. function ...
0
votes
2answers
247 views

In WooCommerce I need to modify the thankyou.php page [closed]

In the thankyou.php template there is an action showing the section marked in red in the image. The problem is the caption/title "Our Bank Detals" should be above the description not beneath. The ...