Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

0
votes
0answers
22 views

Action Hook before Product Subtotal in Woocommerce Cart and Checkout

I try to insert (hook) a custom row just before the first subtotal row in the cart page and checkout page with a function in my functions.php. I checked the official Woocommerce Hook Reference Site - ...
0
votes
0answers
6 views

There is any hook that fires after/before updating menus locations in “Manage Locations” tab?

I'm looking for hook that fires before or after updating menus location. I want to fire function after saving on "Manage Locations" tab in Appearance > Menus. I know there is wp_update_nav_menu ...
2
votes
0answers
14 views

Admin settings update updating every time home page is hit?

I have created a plugin that sends an email with all orders placed that day by X o'clock to email Y. I followed the tutorial here: https://scotch.io/tutorials/how-to-build-a-wordpress-plugin-part-1 ...
0
votes
1answer
524 views

Create action running on trashed_post hook to modify post_meta value

I have a custom post type that always do math operation to its post_meta and other custom post type post_meta. For example: post-type 1 = cpt_product_order post-type 1 post_meta = ...
3
votes
5answers
2k views

Wordpress auto login after registration not working

So I looked up a bunch of threads trying to figure out how to automatically log a user in after registration, and came up with this. function log_me_the_f_in( $user_id ) { $user = ...
0
votes
2answers
25 views

Admin page and admin menu. Permissions plugin

I was googlin really hard but couldn't find any answers. What i'm trying to do is write a simple permission admin page plugin. So far what i did a page with every role where i can check a certain ...
2
votes
1answer
750 views

save_post hook not triggered in WP v3.6.1

I developed a plugin having a custom metabox that is using the save_post hook to store data. The plugin is 18 months old and is used by thousands of customers, so I'm pretty sure everything is good. ...
-3
votes
0answers
17 views

Woocommerce with Different Paypal accounts

I have set up a store for a chain of restaurants, there is a section to select location of Store, So What I want is, assign separate paypal email accounts for each store locations, so When a Customer ...
0
votes
0answers
14 views

On update, set post status to 'draft'

In my website I have created a custom post type named "Activities". A certain user group is able to add/edit these posts. I'd like to set the post type to "draft" each time a user (not administrator) ...
0
votes
1answer
15 views

Hook to change Author Info

Is there a hook or filter that will allow me to change the author of a post when someone views the page? Thanks!
0
votes
2answers
534 views

Add_menu_page() error message -> “You do not have sufficient permissions to access this page”

I'm currently building a website for a friend and have assigned him the user role of editor. I don't want to give him an administrator role in case he breaks the layout. Anyway, I am using ...
7
votes
5answers
7k views

Is there a way to set default custom fields when creating a post?

When I'm creating a new post, just after clicking "Add New", when the post editor shows, instead of having to use the dropdown and choose a custom field to use, I'd like to have some default custom ...
3
votes
0answers
20 views

Adding a drag and drop re-ordering from a custom post type default list

I have custom post type named 'slider_to_be_ordered' and has the following arguments enabled: 'supports' => array( 'title', 'page-attributes' ), 'hierarchical' => true, ...
1
vote
1answer
34 views

External Authentication, session_tokens not destroyed on logout

There are many questions and answers on external authentication and some code prior to WordPress 4.0 need some tweaking to get them to work. For example, adding a fourth parameter to the ...
1
vote
0answers
19 views

Wordpress form. Variables to display on other page? [closed]

I'm using Ninja Forms, and I'm working on a form where when the users presses "ok" then the page is supposed to go to another page which shows specific information and links for that user. Right now ...
1
vote
1answer
28 views

Understanding WP

Sorry if this is a newbie question. For designing a woocommerce catalog page i usually copy woocommerce template folder into theme folder and start editing that (overriding template). I see there are ...
0
votes
0answers
11 views

Best way to change the author's name on view only

I'm developing a plugin that allows users to sign in and make posts. However, I have a substantial number of users and don't want them to be added as users in WordPress's user database, so I have my ...
6
votes
2answers
151 views

What is “all” in isset($wp_filter['all])

I'm a newbie in WordPress. I'm trying to understand how it generates the XHTML pages. I guess it's the function of do_action( 'hook-name' ) , but I'm stuck with the understanding of the instruction ...
1
vote
0answers
14 views

WooCommerce Template Override or Hooks for update safe customization?

I'm about to create a custom online store using WooCommerce for a client and I wanted to know some people's opinion on whether overriding the WooCommerce template structure or adding html code through ...
0
votes
1answer
18 views

Modifying the wordpress login page and then referencing it with a shortcode problem

Both parts are working great separately. I have made the shortcode for the login form with: //register new shortcode add_action( 'init', 'my_add_shortcodes' ); function my_add_shortcodes() { ...
0
votes
1answer
38 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 ...
5
votes
1answer
50 views

How to customize the WP admin default help contents

I will be needing to customize the WP admin default help contents to be tailored specifically to a client in navigating his custom dashboard What are the hooks and sample codes to use in ...
0
votes
1answer
19 views

How to append custom text to the output of 'categories widget'?

How do I customize the "categories widget" to append additional text on the sidebar display? from category 1 category 2 category 3 category 4 to category 1 folder category 2 folder category 3 ...
2
votes
1answer
28 views

How to exclude certain widget from showing up on home/front page? [duplicate]

Without using a plugin, how do I prevent/exclude the sidebar widget "recent posts" from showing up on the home/front page? I do want it to show on the sidebar of rest of other archive/post pages.
1
vote
0answers
27 views

Shipping Options in Fedex Plugin for WooCommerce [closed]

I am a longtime PHP developer but new to WooCommerce and plugin development. I have a need to limit the transit time for certain perishable items. Therefore, I cannot always offer Fedex ground, but if ...
1
vote
1answer
27 views

Insert term when page is published - avoid duplicates after edits

So i want to dynamically add terms to a custom taxonomy named after new pages when these are published. Problem I have is that when you edit the page titles, another term will be added to the ...
-2
votes
2answers
55 views

Customise Jetpack Publicize text

EDIT: Due to downvotes (with no comments!), I've edited this post to be a bit more specific... Why isn't the following change working? $custom_message = get_the_title( $post->ID ) .''. ...
0
votes
1answer
17 views

Rewrite rule pagination on different url levels

I have a custom post type called shop with product posts in it. This post type is connected to a taxonomy shop-category, to specify a product section inside the shop. Each product has a item_width ...
0
votes
1answer
21 views

Show modified time if post is actually modified

I want to display post updated time only if post is modified, I am using function the_modified_time() . So I just read about that there is if statement that can be used to check if post is even ...
1
vote
2answers
582 views

How to use the 'comments_number' filter?

I'm not sure how to use this filter. Could someone show me an example? I'm trying to change ('0', '1', '%') to ('0 Comments', '1 Comment', '% Comments'). I'm using this function to get the comments ...
1
vote
0answers
25 views

__NAMESPACE__ with register_activation_hook

Im teaching myself namespaces and OOP in wordpress at the moment so bare with me. In the base of my plugin I'm loading activation and deactivation hooks. Currently the deactivation hook works but ...
0
votes
1answer
23 views

I need to hook and change language of facebook sdk

I need to hook into this function to change language to from en to french facebook sdk. $facebook_sdk_src = apply_filters( 'bimber_facebook_sdk_src', ...
3
votes
2answers
35 views

Where to hook into post content?

Which hook or filter is used to edit the post content before the_content filter is applied to it. For instance, if I wanted to add Hello World, as the first text in every post.
0
votes
0answers
28 views

First hook to use current page post id

I'm trying to find the first hook that will pass the current post ID, as I would like to update the current post (by getting its ID) and the variables submitted to that page. This is the code I'm ...
0
votes
1answer
21 views

Multi hook deploiement

Having this : <?php class Planner_plugin{ public function __construct(){ add_shortcode('planner::display', array($this, 'display_planner')); register_activation_hook( ...
-1
votes
0answers
29 views

Headers already sent error when activation hook

This code : <?php class Planner_plugin{ public function __construct(){ register_activation_hook( __FILE__, array( 'Planner_plugin' , 'install')); ... } ...
1
vote
0answers
61 views

disable active plugins for specific theme

I want to disable some plugins from a specific theme.I am using deactivate_plugins hook to deactivate. following is my code. add_action('wp_head','disable_plugins'); function disable_plugins(){ ...
3
votes
3answers
3k views

Check if action hook exists before adding actions to it

I am trying to add a rel=next and rel=prev link tags to the head element of image.php template file. I have Wordpress SEO installed and I like to hook to this plugin wpseo_head action hook to achieve ...
0
votes
1answer
22 views

After plugin activation hook

Does it OK, to send email (to me) after user activate my plugin? Does it a right way to do that (https://developer.wordpress.org/plugins/the-basics/activation-deactivation-hooks/) with hook? thanks
2
votes
1answer
44 views

add_filter() function misunderstanding

I'm studying the theme "one page" and there is the following code: function onepage_sections() { $sections = array(); $sections['service_section'] = array( 'id' => 'service_section', ...
0
votes
1answer
864 views

Add content after get_header

I'd like to add content directly after the div#main (end of header.php) and before /div#main (beginning of footer.php). I'm using an own child-template (of twentythirteen), that contains only ...
0
votes
1answer
529 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
23 views

function to write the output of a variable + post_title in post_content

I have a function that writes the output of a function of a rand_keys + the post_title in post_content, but writing the title but only happens after I click manually on the update button on the ...
0
votes
1answer
25 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', ...
1
vote
1answer
30 views

Wordpress Hook that will run when media file deleted

I am very new in wordpress and I am currently developing a wordpress plugin, I just want to know if there is a wordpress plugin hook that will run when one or more file of wordpress media is deleted. ...
1
vote
1answer
26 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 ...
1
vote
1answer
34 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
17 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' ); ...
2
votes
2answers
2k views

Is there a hook for user activation (after they click the email confirm)?

Is there a hook for user activation (after they click the email confirm)? I am creating a plugin to automatically add them to my email software, but I want them to have to confirm their email first.
1
vote
1answer
18 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 ...