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

learn more… | top users | synonyms (2)

0
votes
3answers
35 views

Action hook on only publishing post not on editing or updating

Could you please let me know wordpress action hook that must triggered only once when a user create a new custom post. That means if user creates a new post that hook must be triggered but when user ...
-2
votes
0answers
9 views

Write name and custom meta box in picture when upload it

I have form to register new user in my site, And i need when user upload his images, i need to write user name and care name (that is from custom meta box) to the images that uploaded it by user. How ...
0
votes
0answers
9 views

Building a request processor for multi-page forms, etc using $_GET requests

Good day, What I'm trying to accomplish in a semi-elegant way today is building a multi-step form type thing. Essentially, I'm trying to rewrite the page based on a $_GET request. Like, say, it's ...
0
votes
1answer
30 views

Prevent function from triggering again when post in specific category gets another category?

I have created a function to send out an email to authors when there post is added in the popular category for custom post type. IT WORKS but there is 1 major issue. If the post that is in the ...
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
18 views

Redirect to another page if the user is logged in when pressing again the login button on menu bar

So I have this button on the menu : "My account" that lets the user login on the website and as soon they log in they're redirect to their dashboard. What I'm trying to achieve is if he's logged in ...
0
votes
0answers
16 views

How to remove the function hooked to action within a class [duplicate]

I want to remove the function listify_single_job_listing_meta which is hooked in action inside the following class class Listify_WP_Job_Manager_Template extends listify_Integration { public ...
0
votes
1answer
29 views

What problems could happen if I replaced add_filter and add_action with the function calling

I'm new to WordPress, and to learn more about how to build WordPress themes, I'm now analyzing the code of a theme I downloaded and trying to make some changes in it. Two of the built-in functions in ...
1
vote
0answers
28 views

add_action shortcut?

I think in PHP 5.4 or above (don't remember the exact version), instead of writing: function some_function() { } add_action( 'init', 'some_function' ); One can pass an anonymous function: ...
1
vote
1answer
16 views

Get posts from WP_Query and format them on admin_head

I am trying to prepare an array with Custom Post Type posts to populate a select options in TinyMCE. I was thinking to fetch posts, get their IDs and titles and put them all inside $data variable, ...
0
votes
0answers
19 views

How do I get the full details of a registered/enqueued script?

I'm trying to get the details (such as src, in_footer etc) of enqueued/registered scripts. For example: add_action('init', function() { global $wp_scripts; var_dump($wp_scripts->queue); ...
1
vote
0answers
17 views

Redux callback action

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 ...
1
vote
1answer
49 views

WP 4.4.1 allow empty comments via add_action 'pre_comment_on_post'

got a question about allowing empty comments with worpdress v.4.4.1 to achieve this i use the action 'pre_comment_on_post'. in WP 4.3.1 i could do this easily: if (isset($_POST['comment']) ...
0
votes
1answer
43 views

Dynamically adding filters

I have a function that I'm trying to get an array in it to use in a callback to dynamically add filters. Here is the function that I need to retrieve the array keys from ( in the $classes variable ): ...
0
votes
0answers
26 views

Filters, priority when run after plugins_loaded

in my main plugin I filter the_content to add rich snippet, something like this: add_filter('the_content', 'add_schema'); function add_schema($content) { $schema=NULL; //To avoid undefined ...
6
votes
1answer
114 views

wp_headers vs send_headers. When to use each?

I've seen wp_headers and send_headers both used before for the same thing and I'm wondering how you're suppose to know which one to use and when... On the send_headers codex page there's an example ...
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 ...
1
vote
2answers
38 views

Delete database tables on theme uninstall?

How can I execute DB queries when theme installs and delete those tables on theme uninstall?
0
votes
0answers
15 views

Get Custom Post Type posts on normal edit-posts and pass to TinyMCE

I am following a tutorial for adding a dropdown list in tinyMCE editor. In the end I would like to have a Select list similar like it is in this image , but populated by post titles from Custom Post ...
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: ...
1
vote
1answer
52 views

Hide posts of a certain category unless logged in

I want to hide posts belonging to a certain category unless logged in. I found some code(attached) in the codex that works great for the loop. But how to ensure the post pages are empty as well? ...
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 ...
0
votes
0answers
43 views

Why a class property becomes empty?

I have a class with a private property/variable named $postID that I can pass successfully (this was tested) to every function within this class except one named handleForm(). When it is passed to ...
0
votes
3answers
44 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
0answers
35 views

Custom Message with Order status from WooCommerce Payment Gateway Callback to Order Thank You Page

I would like to pass on the custom message to order-received page in woocommerce. Here how i currently handle the callback from payment gateway if ( isset( $_REQUEST[ 'callback' ] ) { ...
1
vote
1answer
21 views

Custom post type unintentionally called in every page

A while ago I was following a Tutsplus video tutorial on creating custom post type, and so accordingly I made 2 similar small custom post types for myself. Today I was exploring ways on how can I ...
1
vote
2answers
131 views

add_action and Ajax

I'm developing a plugin and I've started from WPPB and Wordpress 4.3.1. I've named it dogmaweb. I need to submit a form to the plugin via Ajax. The form is created by the plugin itself. In my ...
0
votes
0answers
36 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?
0
votes
1answer
17 views

Run only on plug-in activation instead of wp_head

I have below function on my plugin which adds more capabilities to current user. // Role setting for add media function wh_edit_roles(){ if ( current_user_can( 'edit_posts' ) ){ $user = ...
0
votes
0answers
18 views

Adding a taxonomy filter

I'm am attempting to add a custom taxonomy filter. I have partially achieved this, I have a dropdown menu that displays all of the desired terms. However when I actually attempt to filter on these ...
0
votes
1answer
14 views

custom COOKIE on custom page

i have problem with create function for set cookie dynamically. when i try in custom page i have of course header is set and i tried something like this: in custompage.php: ...
0
votes
1answer
22 views

Wordpress user account activation

How to implement user account activation in WordPress, it's not a multi-site. Once user registered through site or admin panel, user should get an email with activation link. Once the link opened ...
0
votes
2answers
43 views

how to repeat taxonomy in different places on wordpress

I need help with this. I need repeat taxonomy in two places, are post, and coupones post, this code is in clipper theme. this code put taxonomy stores in coupon. add_action('init', 'clpr_post_type', ...
0
votes
1answer
25 views

Adding a conditional to work on certain pages/page templates to an add_action()

function wpufe_auto_login_new_user( $user_id ) { wp_set_current_user( $user_id ); wp_set_auth_cookie( $user_id, false, is_ssl() ); } add_action( 'user_register', 'wpufe_auto_login_new_user' ...
0
votes
3answers
36 views

Sending Parameter Failed

This is so basic, but i couldn't understand why it's not working, i'm trying to send parameter from add_action(), this is my code in my function.php: function testingID( $testParam) { ...
0
votes
1answer
28 views

Am I using an action hook correctly?

I want to extend an existing plugin by writing my own. I think I instantiated it correctly because it appears on the plugin list in the dashboard (although I found it strange that I didn't need to ...
0
votes
0answers
15 views

Is there any hooks or filters to detect an action after user upload video to AWS (Amazon Web Service)?

I am using the plug-in AWS and offloads3 to upload video to AWS, however, I would like to find a hook or filter to detect a state when after user uploaded video/image successfully to Amazon web ...
0
votes
0answers
27 views

Is it bad practice to use $_POST['post_type'] in an action hooked on save_post?

In a custom plugin I wrote an action hooked on save_post that Only needs to fire when a particular Custom Post Type is modified Sometimes uses wp_insert_post to add a post of a second Custom Post ...
0
votes
0answers
29 views

Custom button on admin page doesn't trigger click event

I created a custom button on the "users" admin page. I have a script (loaded correctly) which should register the button click, but it doesn't. I followed an example where they hooked the ...
0
votes
1answer
21 views

check, if any “add_action” function contains string XXXXXXXXX

i want to filter out any function, that output such string : http://twitter.com/xxxxxx.js (this is example,i will need other strings to filter out..) is there any way, to find which "add_action" ...
1
vote
2answers
67 views

action hook wp_head higher priority as all other plugins/hooks

I work a bit with the wordpress API and I want to try to include a <meta>-tag into my head area of my website. This is my code (works everything fine!): class dmd_noindex_options_page{ ...
0
votes
1answer
85 views

wp_ajax action is not run when ajax trigger

I'm trying to implement the ajax in wordpress world but now stuck. Function hook suppose to be called when ajax triggered is not happening. I check the network admin-ajax.php is called but ...
0
votes
1answer
28 views

Add action to custom Function

I am trying to use plugin action in my custom function. Plugin is adding an action to wordpress registration form add_action( 'bp_before_account_details_fields', 'tv_bp_avatar_upload_form' ); But ...
0
votes
1answer
86 views

How can I hook into existing WordPress Bulk actions?

I am creating a plugin which syncs both standard WP data and custom fields within a custom meta box on post edit pages, to an external resource using SQL queries. However my functions are currently ...
0
votes
0answers
18 views

Add action after function defined in plugin

I'm trying to write my second ever plugin (my first was a derivative of Hello Dolly) and I have a function that does something, however my issue is that I don't know what action to use to call my ...
1
vote
0answers
33 views

Using pre_get_posts to Filter Posts

I'm trying to filter archive_research.php to show only the research with status=current. In functions.php: add_action( 'pre_get_posts', 'only_current' ); function only_current( $query ) { if ( ...
0
votes
1answer
96 views

Add my own function to existing WooCommerce hook

I'm trying to customise my WooCommerce child theme with parent theme Storefront. The parent theme creates single product template (content-single.php) like this: /** * @hooked storefront_post_header ...
0
votes
0answers
11 views

How to trigger an email when a posts metadata has been updated?

I'm really struggling on this one, so I appreciate the help from all of you guys/gals. I've built a progress bar type of application for a client. The basic setup is that each project (custom post ...