Questions tagged [actions]

A name for an event that is executed at specific points throughout the WordPress core.

Filter by
Sorted by
Tagged with
0
votes
0answers
7 views

Avada Fusion_Dynamic_CSS_Inline::add_inline_css_wp_head method is very slow! [closed]

I'm facing some performance issue regarding default classes of Avada Theme. This filter calls every page load of avada theme and it is very slow. when i try to remove that function from hook but, CSS ...
0
votes
1answer
17 views

post value to function with Ajax and jQuery

This is how you would create a custom smart tag in wp forms: function ea_custom_smart_tags( $content, $tag ) { if( 'my_smart_tag' == $tag ) { $value = 'Testing 1 2 3'; $content = ...
0
votes
0answers
6 views

admin_notices hook is not working when the request method is POST

Trying to write a plugin and I have suddenly came to this problem and not sure what wrong I am doing. I know there must be something wrong but I cannot figure it out.. admin_notices work as usual, but ...
0
votes
1answer
18 views

Inject HTML meta tag inside wordpress <head> tag using add_shortcode

I am trying to add some meta-tag when shortcode [refresh url='http://stackoverflow.com'] tag is used. I have done below code, but it is not working, I want to inject HTML code between "<head>" ...
1
vote
1answer
13 views

Adding custom fields to bbpress reply form

Referring to post "adding-custom-fields-bbpress-topic-form" with link https://wp-dreams.com/articles/2013/06/adding-custom-fields-bbpress-topic-form/, I want to add custom fields to bbpress reply form ...
0
votes
0answers
30 views

remove_action not working for a function

I want to remove specific function from wp_footer action. This is what I added in functions.php of my child theme. remove_action( 'wp_footer', [ 'Fusion_JSON_LD', 'print_json' ], 999 ); In this line ...
0
votes
0answers
10 views

How to submit multiple nonces at once?

I have a form that incorporates three different forms from a plugin. Usually, each form would have it's own submit + nonce (which already exist and work), but I need to have just a single submit ...
0
votes
0answers
5 views

Woocommerce - change the order of DOM elements in single product page

Here's an example for a product in my website: https://lutra.co.il/product/%d7%92%d7%a0%d7%a8%d7%98%d7%95%d7%a8-5500w/ I'd like to have 'similar products' (מוצרים קשורים) shown before 'reviews' (...
0
votes
1answer
26 views

Is_Page doesnt detect my page

I want to call Servicedeneme.php which is in main folder of theme, in mysite.com/faq/ It's title is FAQ so I write code for two form which are faq and FAQ.However, it doesnt work. I write below code ...
0
votes
0answers
16 views

How do you insert code into the sidebar?

I would like to add code to the top of the sidebar. When I do: add_action('get_sidebar', 'function') It adds above the sidebar DIV. I would like to insert inside the DIV. If I do: add_action('...
0
votes
1answer
18 views

How Do I Unhook This Parent Theme Function?

In a parent theme I have a function like this, that removes hyperlinks from comments: function preprocess_comment_remove_url( $commentdata ) { //some code... return $commentdata; } ...
0
votes
1answer
29 views

save_post_{$post->post_type} action firing on second save

I have custom metabox checkbox on CPT in my plugin. I want to fire an action and save new option when I save this post. But no matter how many times I tried it's saving option value only on second ...
0
votes
1answer
29 views

admin_notices is not working inside function

I am creating a plugin . But when I trying to call the add_action('admin_notices','my_test_notice_1'); inside a function its not working. I need to call the add_action('admin_notices','...
0
votes
0answers
16 views

Hook to add content after date in post?

This code function test($the_date) { return $the_date . 'after'; } add_filter ('get_the_date' , 'test'); adds 'after' after the date, which is what I want. But it adds it inside the date link tag....
0
votes
1answer
25 views

Adding code before post title with the_title produces weird results

add_action ('the_title' , 'test'); function test($title) { $mycode = '<div>test</div>'; echo $mycode . $title; } I expected this functions.php code to add "test" before the ...
1
vote
1answer
28 views

How can I trigger actions manually?

I am working with Gravity Forms and the Webhooks Add-on, but those may or may not be relevant to my question. If I have an action defined with a hook in my functions.php file, is there an easy way of ...
1
vote
0answers
73 views

remove_action returns false regardless of priority

I am writing my own plugin to customize a public plugin. My plugin is doing this customization by removing an action via remove_action() and adding it back with my customized code. The code below ...
0
votes
2answers
12 views

Make a treatment before the action of the form

I have a form that redirects to a payment platform and sends data in $_POST. <form method="POST" action="https://www.paiementgateway.com/paiement/order1.pl" accept-charset="UTF8" id="knp-form" ...
0
votes
0answers
14 views

Wordpress action not working inside another action

I am developing a plugin where I want to add some script only when the metabox will add . So I tried following code add_meta_box( $args['id'], $args['...
0
votes
0answers
35 views

Parameters in woocommerce_before_add_to_cart_button hook

I need pass parameters to woocommerce woocommerce_before_add_to_cart_button hook. In my functions, I have a function that calls: /** Yiith: evitar pagar dos veces por el mismo depósito, obliga a ...
0
votes
1answer
16 views

Use another action instead of the shortcode API to display the last time a user logged in

Here's my problem: if ( !class_exists( 'printSecurity' ) ) { class printSecurity { public $constant_name_prefix = 'PRNSEC_'; public function __construct() { define(...
0
votes
1answer
20 views

Call to Action Button - Resize Help [closed]

I need help with resizing the "free quote" action button on my website. It is placed on the menu on the right top corner. I need to resize it to smaller size so that it fits the size with other text ...
0
votes
0answers
18 views

Is update_post_meta used when save_post action hook is invoked?

Here, I have some code which applies some indexing operations on an external service (Algolia). My purpose, is to index posts in a similar way, as described in their API documentation. For that cause, ...
0
votes
0answers
17 views

form action value to another websites php file

Im currently working on a wordpress theme project and in this project i need to set php form action value to an external online php file that isnt in our server. I've created a form and set the ...
0
votes
0answers
15 views

Update Post Meta not working for Custom Post Type

I am trying to fetch the data from the database and update the post meta. Everything is perfect. I have even checked each variable. The method is also firing only once. The problem is that in the ...
1
vote
1answer
37 views

How to check current user before all actions and filters?

I am working on a plugin with 50+ actions and filters. All actions and filters only apply to users with a specific user meta (b2b). I want to check this user meta before everything How can I do this? ...
2
votes
1answer
25 views

WP action is not triggering a do_action() call within?

Okay, so I have a plugin on my site that triggers a do_action(). In a second plugin, my custom plugin, I hook into this action and end up calling a do_action() for another custom action of my own. ...
1
vote
1answer
44 views

How to add custom script to the particular Product Category page

I am trying to add the script to the particular Product Category page, but the code is not adding it to the category. Page (working): function wpb_hook_faq_javascript() { if (is_single ('8') || ...
0
votes
0answers
31 views

Contact Fom 7 - how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control?

Contact Fom 7 - how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control ? Using the 'Query Monitor' plugin I found that the HOOK which I need to ...
0
votes
0answers
87 views

do_action add_action in wp_ajax call not executing

In a wp_ajax call I've put some do_action hooks. The add_action for them are not executing My code: add_action( 'wp_ajax_wbulk_update_action', 'wbulk_update_action' ); function wbulk_update_action()...
-1
votes
2answers
41 views

Where can I find the “add_action()” inside a theme?

I'm developing a WordPress plugin for a site that is using the theme ColorMag. The plugin uses the_content() to insert some content in a page. When I put the plugin in other test site, the content is ...
0
votes
0answers
42 views

Custom filter from post meta

I am trying to create a dropdown filter on the custom post type record listing page. I have it showing up using a dummy array but can't get it to work with actual data. function ...
0
votes
1answer
133 views

WordPress Custom Shortcode Conflicting with Media Library

I have written a small function that displays a Custom Post Type called Testimonials (in my case) using a shortcode. The Shortcode runs properly. But I noticed 1 major problem with that. My ...
1
vote
1answer
22 views

How to manage arrays from custom functions stored in functions.php?

In functions.php I have made the following code: add_action( 'listofnames', 'SomeNames' ); function SomeNames(){ $names=array( "john","edgar","miles"); return $names; } It should return array I ...
0
votes
1answer
16 views

I want to hide “sold by” on certain pages with id page 43

I want to hide "sold by" on certain pages with id page 43 if I use this code, it's hidden for all pages on my site / Remove sold by in product loops / remove_action ('...
0
votes
1answer
28 views

cannot filter after using pre_get_posts

I am using pre_get_posts() in the backend for a custom post type screen where all the records are usually displayed. The action I have is showing only posts for today's date. This is working fine ...
0
votes
0answers
36 views

WooCommerce Single Product Page Variations - SKUs Duplicating / Not Resetting

Discovered an issue with displaying SKUs on a Woocommerce single product page. I'm using two theme functions, the first displays the SKU in the upper description area, the second displays the SKU for ...
0
votes
0answers
29 views

How to remove default action from a plugin?

I'm trying to remove the default wordpress action: add_action( 'do_pings', 'do_all_pings', 10, 1 ); from wp-includes/default-filters.php This is the code I have (plugin): add_action( 'init', '...
1
vote
1answer
17 views

Which action is triggered when a theme was modified?

I want to intercept plugin changes, but no action hook listed in the Action Reference seems to do it. I tried after_switch_theme which is triggered only after changing from one theme to another, and ...
0
votes
1answer
29 views

New bulk action to resend welcome emails

I have added a new custom bulk action to the user listing page called Resend Welcome Email, it is showing and running. What I'm looking to do is fire the Resend Welcome Email plugin's action. I'm ...
0
votes
0answers
38 views

Removing Plugin Action via Theme for Non-admins

add_action( 'plugins_loaded', 'mytheme_remove_show_my_balance' ); function mytheme_remove_show_my_balance() { if ( !current_user_can( 'administrator' ) ) { remove_action( 'personal_options', ...
0
votes
0answers
15 views

When calling a function with admin-ajax.php, what is the first parameter? [duplicate]

I'm trying to make a function that can either be called directly or via admin-ajax.php. Strangely, when calling it as an AJAX function, the first parameter's value is a blank string. function ...
0
votes
1answer
25 views

Adding JavaScript file in Admin Panel

I am learning WordPress plugin development. I am trying to attach a jQuery/JavaScript file in Admin Panel. I am using below code in plugins index.php file. function admin_script() { ...
1
vote
1answer
20 views

Adding buttons to Add New Post and Add New Page

I want to add a button in Add New Page and Add New Post pages. Here are places I want to add items: New page's sidebar (next to Page Attributes). New post's sidebar (next to Post Attributes). New ...
1
vote
0answers
24 views

Set a custom display_name on user_register?

I'm trying to force a specific "display_name" using data collected in a wpforms registration form. In the registration form, I've got a field for "last name in high-school" and a field for "nickname ...
0
votes
1answer
43 views

How to position user meta data field

I have 1 additional field I want to display on the user profile page (mainly admin users will use this) I have done it but it is showing up at the very bottom of the page, I want it to sit in the ...
0
votes
2answers
49 views

do_action not working in loop

I've been using do_action to generate multiple action hooks in the loop. It seems unlucky for me the do_action not working. function ltc_generate_input_fields($fields = array()) { echo "Hello ...
0
votes
1answer
37 views

How to change lost password email text using custom plugin wordpress?

In wordpress, i want to add one extra parameter(ABC) in lost password link with key (lost password email text). I have added many hooks. add_action( 'password_reset', 'password_reset_hook', 10, 2 ); ...
0
votes
1answer
26 views

What's the correct way to add capabilites to user roles?

A third-party plugin adds the capability 'edit_booked_appointments'. I'd like to assign this capability to the already existing user role 'editor'. I created the following function in my child theme: ...
0
votes
0answers
16 views

Add User in Admin and Redirect to Edit Profile Page instead of Users List

I'm probably missing something super simple, but how can I redirect the admin user to the edit profile page when they create a new user? I've tried to hook into this: edit_user_created_user and then ...

1
2 3 4 5
26