Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

0
votes
0answers
19 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 ...
6
votes
1answer
165 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
18 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
60 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
27 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 ...
1
vote
1answer
32 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
15 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
17 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
23 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 ...
-1
votes
0answers
9 views

Two different languages for Wordpress: Spanish for Admin, English for Site [duplicate]

I need to setup a Wordpress where the backend (admin) will be on Spanish and the frontend (site) will be on English. I am doing in this at functions.php in the child-theme: function ...
2
votes
0answers
32 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
33 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
28 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
28 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
26 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
31 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
10 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
58 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
60 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 ...
0
votes
0answers
36 views

Removing item from Woocommerce cart

I am using the template_redirect action hook to try and remove items from the cart, but having an issue with variable products. I found it was only affecting variable products by adjusting my code to ...
1
vote
0answers
13 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
53 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 ...
1
vote
2answers
45 views

In WooCommerce I need to modify the thankyou.php page

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 ...
0
votes
2answers
45 views

How can I check user capability when a page loads (via functions.php)?

I need to restrict users without a specific capability from seeing a specific page. I can't use shortcodes or anything like that, I just want to redirect them if they get to that page URL. I want to ...
6
votes
1answer
130 views

Does hooking into the same action multiple times drain memory?

Currently I have three functions that run on pre_get_posts. I call them like this: add_action( 'pre_get_posts', 'private_groups' ); add_action( 'pre_get_posts', 'search_results' ); add_action( ...
0
votes
1answer
28 views

Plugin: Hooking up classes that have their own hooks

Was wondering if there is a "best" approach to hooking up classes that has their own hooks, still making sure that those hooks haven't run before the class got a chance to declare it's own said hooks. ...
1
vote
1answer
30 views

I don't understand why I shoud use lostpassword_url hook?

Look into my comment in the code below: // WHY can I not just do this? class Customuser { public function __construct() { // Using this when using lost password functionality ...
0
votes
1answer
20 views

How to check which submission button was clicked?

So I added a new submission button to the edit page: Using the post_submitbox_misc_actions hook with the submit_button($text, $type, $name); function. I wanted to modify the data that's saved based ...
0
votes
1answer
25 views

How to get the postID inside 'content_save_pre'? Other hook?

I need to get the current PostID. I think in the function the postID is not existing yet. (Because save pre ...) add_filter('content_save_pre', 'getImageUrlOutOfContent', 10, 1); Am I right? How I ...
0
votes
1answer
33 views

WooCommerce: Add Payment Gateway Field to Webhooks [on hold]

I have created a custom Payment Gateway for a special EFT system we have setup. The Bank Account and Routing Number are supposed to get encrypted then sent to a Salesforce via the WooCommerce webhooks ...
1
vote
1answer
42 views

Create a plugin to change the action to which a function is hooked

I have a plugin that hooks a function on to the woocommerce_before_my_account action. I would like instead for the plugin to hook that function to the woocommerce_after_my_account action. If I ...
0
votes
1answer
25 views

How to use the post_updated hook before and after arguments

I want to check if the title of the post has changed and do some stuff if it did. I thought of using the post_updated hook, the codex says "Use this hook whenever you need to compare values before ...
0
votes
1answer
49 views

how to make custom ajax handler?

i'm trying to make custom ajax handler because the admin-ajax.php is taking to long to handle ajax requests from 7s to 10s so i google it and mange to do some custom ajax-handler.php like this ...
-2
votes
1answer
35 views

Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]

Hi is it possible to make an extra field in backend, when orders are selected and marked as shipped then an extra field come and where i can select drivers who are responsible for this shipped order ...
0
votes
0answers
16 views

plugin development for woocommerce

i create this plugin: A discount in % for woocommerce price, but i have a problem: add_action( 'woocommerce_product_options_general_product_data', 'crele_add_custom_general_fields' ); add_action( ...
0
votes
0answers
15 views

How to add new tab and data in Wordpress Users section

I have to add new tab and new data in wordpress users. Please see the image below. The points tab came from the plugin mycred but i don't know what was used. What I think was it was done using: ...
0
votes
0answers
20 views

Execute code only after user clicks 'update' button for CPT being edited

In my plugin, my custom post type posts might be updated either by a user clicking 'update' on the editor page, or programmatically. I need to execute a settings validation routine only when the ...
0
votes
1answer
58 views

Add action hook into wp_localize_script

Is it possible to add an action hook via wp_localize_script, so I can position where I want the hook to run in HTML markup that is made in the JavaScript? So something like: $data = array ( ...
-1
votes
1answer
20 views

The acction hook stop working if i move it from plugin file to theme's functions.php file

A bp_includes is buddypress action and hooked on plugins_loaded function remove_bp_docs() { global $wpdb; $current_user = get_current_user_id(); //We are selecting member type before ...
-1
votes
2answers
55 views

How can I add a custom meta value on file upload?

I am looking for an option where a custom meta value will be saved when user uploads an attachment. Lets say I need a meta key _example_meta_key and want to save meta value of this as ex087659bh (It ...
2
votes
2answers
42 views

How often do you need to register_post_type?

Assuming you write a plugin and hook into activation / deactivation to register_post_type is that good enough? Or do you need to do it every init? I'm looking for perf boosts and I want to reduce ...
0
votes
3answers
45 views

Which action hook should I use to intercept a form upon submission?

I have a form on wordpress page with a POST method. I need to add an extra field to the form after submission but before it is sent to the URL in the action attribute. I was thinking to use an ...
0
votes
1answer
41 views

How to replace default comments with custom HTML?

I'm going to replace default list of comments and comment form with Facebook's comment box. As far as I know there is function wp_list_comments(). How can I replace this function with my custom one? ...
5
votes
2answers
68 views

Add custom html to last sub-menu item

I'm adding a custom menu to my wordpress theme. I need to add custom html to the final submenu item - before the primary sub-menu closes </ul> I have registered my new menu //functions.php ...
1
vote
1answer
59 views

Gravity Forms - Using a Form to Pre-populate A Gravity Form

I have a custom form (hardcoded, not a GF) on one page I've written myself: <form id="tailor-select" method="POST"> <ul> <li> <ul> ...
1
vote
1answer
23 views

How do I add a checkmark to my-sites save settings hook

I want to add a checkmark to the my-sites.php through a hook and then press save settings and have it do a function that executes a SQL query. I've added the checkmark but I don't know how to go ...
2
votes
1answer
61 views

Removing labels and <br> tag on WordPress's default login form

I am customizing the login form to more closely resemble Google's minimalist form, which has no form labels, and instead relies on placeholders to prompt users for the input fields. The form starts ...
-1
votes
1answer
27 views

How do I add functionality to images?

How would I add functions to images? I host a photography site, in which I'd like to add options to favorite an image or attach it to a product for ordering. Is there a hook or something that I can ...
0
votes
0answers
37 views

On WP 4.4, how to get the post id on comment_post hook

Since WP 4.4, seems like is not possible anymore to use get_the_ID() or the_ID() when hooking on comment_post action. How can I get the post_id when a new comment is saved?