actions's questions - English 1answer

1.099 actions questions.

I am struggling with this problem for hours now, what is going on is that somewhere before inserting the values into the db, this action is being called. do_action_ref_array('h5p_alter_user_result', ...

i have class like this if ( ! class_exists( 'My_class' ) ) { class My_class { public function __construct() { add_action( 'woocommerce_shop_loop_item_title', array( $this, '...

I have good experience in other CMS. but I'm very new in Wordpress. My goal is to intercept POST values in some of the form of a pre-existent site. Following documentation I've done the following ...

I am trying to add this to functions.php. In my test lab on a different site it adds the test info information fine. But on the website I am trying to add it to nothing happens. The website is running ...

I'm currently trying to update a post's meta value within the save_post action. The problem with this is that it gets overwritten immediately. I've been banging my head on this problem for several ...

I am developing a plugin which will show the caller of all the Hooks & Actions on a Page in Wordpress just like QueryMonitor. I know that global $wp_action & $wp_filter has all the information ...

Just have a query reference the add_filter() function. Can you use this function inside a WordPress widget class. Example I have a widget with dynamic created code that I want to pass to another ...

I have a custom post type called "Magazine" shown in the admin interface. Everytime a user uploads a file in the wp-admin to my custom post type "Magazine", I want to fire a hook because I have to ...

I am developing a Plugin, and want to record Time taken by each Action Hook, I am able to get all the Hooks Triggered on a Page with the Action and Priority, but i am unable to get the Time taken by ...

I have added a custom meta box for advanced information for a specific post category, to my create new post page. Now I recognize, that if I save the post, it writes 2 entries in the db with 2 ...

I'm setting up my page as follows: add_action( 'admin_menu', [$this, 'addAdminMenu' ], 80 ); And its content: public function addAdminMenu() { $this->hook_suffix = add_theme_page( ...

Is there a way to trigger the post saving or updating event in code? such as do_action('save_post', $post_id); The function here seems to imply that a WP_POST object needs to be passed in. Is there a ...

I'm wordpress developer and want to add roll back to previous version or some other subversion inside one of my plugins. I tra to Google this but neverfind workable solution. Do anyone have idea how ...

I want to run a custom function whenever posts are imported to my custom post type. I am currently running this code - function on_post_import($post){ global $wpdb; $results = $wpdb->...

I'm trying to unregister a post type from a child theme but I haven't been able to do so, the code in the funcions.php file on the parent theme is something like this: add_action( 'init', '...

I am using 'woocommerce_admin_order_actions' hook to add an additional action like Invoice. But it is repeating many many times whereas others button are repeating once. public function ...

im trying to redirect users on specific categry with this hook: // Show app-data posts only to app users function user_redirect() { if ( is_category( 'app-data' ) ) { $url = site_url(); ...

I created a class extend WP_List_Table and created method for bulk actions like this : function get_bulk_actions() { $actions = array( 'synchronize' => 'Synchronize', ...

I am creating something for a client and I have a Class that I created with a Custom Post Type called 'PuSH Feeds' and when the user adds a new post and publishes it they can then click on one of two ...

I’m trying to set up some post permissions using taxonomies and I'm applying my rules in a pre_get_posts action. It’s working fine when multiple posts are found, but in class-wp-query.php near line ...

I am using wordpress ajax login without a plugin. I want to not be allowed users access to the WordPress profile after login, Because i have designed a specific profile in the link: http://www....

I'm new to WordPress and php. I would like to write a function that triggers when a specific post has its content updated. I came across 2 actions, save_post and post_updated. I'm a little confused ...

I have a plugin and I would like to be able to run the post content through some filters before it is saved to the database. From looking at the plugin api, I see that two hooks that look like they ...

Is there a way to change the meta tags not in the head but in a template file through code? I would like to change the meta tags <meta property="og:title" content="title" /> <meta ...

I want to write the post title with the content of a custom field $sentence_number, this way: add_action('save_post', function ($title, $post_id) { $post_type = get_post_type($post_id); if ($...

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 = ...

I want to add a filter to a form submission like it is done here. add_action('gform_pre_submission_6', 'capitalize_fields_6'); function capitalize_fields_6($form){ // Code here } My question is, ...

I have a function that loads a script for validation and i want to add it for only 'login' page. this the function: function include_regForm_validation() { wp_register_script( '...

I'm very new with Redux. I don't know how to show and hide a textarea using switch (without saving). When my switch turns on, the text input displays and when it turns off, the input hides itself. I ...

I am trying to create a hook that when a user login, it check the user role.. if the user role is jsa_contributor then it redirect into specific page. but it seems my code didn't work. This is the ...

I've registered post type with following -- $holidayLabels = array( 'name' => __( 'Holidays'), 'singular_name' => __( 'Holidays'), 'all_items' => __( 'All Holidays'), '...

I have a question about this documentation. Why would I register a Custom Post Type in the init function as the docs suggest? Is this only if I am not using a plugin? As I understand it, init runs ...

publish_post is an action triggered whenever a post is updated and its new status is "publish". Is there similar action which is trigger when cron is run including WordPress default crons? I am ...

I have a starter theme I use for most websites I built myself. Because each site has different plugin dependencies, I'm trying to create a script that essentially collates a list of all plugins ...

For some reason, I have to unpublish certain posts every time wordpress loads. This is my code: function af_change_post_status() { $notpayed_posts = new WP_Query( array( 'meta_key' ...

I am using bimber theme on latest wordpress. I wanted to force all frontpage views behind a login and added the following code in bimber's functions.php function members_only() { // Check to see ...

I am using save_post for a function to send an email when a post is updated by a user. This is firing twice and I am aware this is due to the post revisions and autosaves. I have tried to prevent ...

Is there any way to change the order of filters for e.g. the_content before they are applied? What I currently have is the following ideas: /** * Print all filters for some hook. */ function ...

I edited my woocommerce loop products with remove_action and add_action functions. And create ajax infinite scroll. I created woocommerce.php and put all my action functions to it. And called ...

I want to prepend text to the post titles of a specific custom post type, but the filter below didn't work. Instead of changing only that CPT's post titles, it changed all titles on the given CPT's ...

I am using plugins that fire action hooks before and after a post save. When a post is saved the functions hooked into those actions perform some calculations and put the results into a custom field. ...

I want my user pay before every post publishing. I searched for some hooks that triggers before a post publishes, but all these hooks run after a post is successfully published and i don't want this. ...

We have a custom post type with custom statuses. I am trying to hook into the moment that a post is created and updated. The idea is to send an email when the post is created and another email ...

We know that there is a certain order for the execution of callback functions attached to action hooks. How does WordPress decide which action should be prioritized while executing all the hooks?

I would like to know if it's possible (using the existing WordPress core development features) to hook into the existing WP Bulk Action > Edit functionality, in order to expose additional fields to ...

Result of the var_dump('parse_query'): WP_Hook::__set_state(array( 'callbacks' => array ( 10 => array ( '...

I use the http://www.deluxeblogtips.com/meta-box Metabox plugin and I want to add a custom action in a post type like the publish button ? when admin click on this button I want to send an email to ...

I have read other answers to similar questions but none of them solved my problem. This code works great in Editor but on Quick Edit or Bulk Edit it does not appear to fire at all. What am I doing ...

I'd like to compress images once they're uploaded to media library. Is there any hook that fires once the image is uploaded and the image sizes generated?

I'm working on a WooCommerce bookstore site with a custom taxonomy.php template that generates different archive pages based on a category called "Highlights". So, for example, there is a "Best ...

Related tags

Hot questions

Language

Popular Tags