Articles of hooks

Creating multiple hooks for theme

Iam working on a theme in the moment and got to the point where I also want to add some custom hooks to some locations, to enable some more flexibility. I want to add multiple hooks to the theme. I have different sections (header, content, sidebar, footer etc) and on all those locations I want […]

How to get the password and username of the add new user form (admin back end) in wordpress

I am trying to get the username and password that entered by the wordpress admin in the add new user screen to use those into creating a webmail account using cpanel api. How to do that? is there is any hook for it? Also, When the user id changing his password, I want to get […]

Issue adding text after short description on product pages Woocommerce

I am trying to add some text after the short description on woocommerce. I have come up with the following add action but when I use it, it replaces the existing short description text. Is there a way to add this after the existing short description without replacing? function show_shipping_price() { echo ‘Order within <b>3 […]

Hook after wp_enqueue_scripts

I want to perform action when scripts are loaded. I mean when scripts are enqueued i want to take some action. Is there a hook after_wp_enqueue_scripts?

Registration and Profile custom field

How to add custom field in wordpress registration form and view it in user profile in the backend? I’ve already google it but just find how to add it in user profile but not in registration process.

How can i do something after head like adding a hook for after head but before post

What i mean is i am trying to add breadcrumbs to my blog and i thought of adding it before content or after title but there’s an issue with that – on archive pages or category pages the breadcrumbs appear for every posts. so i figured i have to attach the breadcrumbs to something above […]

Reposition Woocommerce Message

I’m trying to reposition the messages in my Woocommerce theme. For example the successfully added to cart message. They appear to automatically be placed at the very top of where the woocommerce wrapper start begins. I’ve already found this link which allows me to change the wording of the message but what I need is […]

Enclosing Shortcode Within Another Enclosing Shortcode Breaks Output Functionality

I’ve seen several questions on this topic, however none of them seem to actually answer the question. I’m currently registering my shortcodes on after_setup_theme. function mbe_register_shortcodes() { require_once( PATH . ‘/inc/shortcodes.php’ ); add_shortcode( ‘font’, ‘mbe_shortcode_font’ ); } add_action( ‘after_setup_theme’, ‘mbe_register_shortcodes’ ); Contents of Shortcodes.php: /** * @param array $attributes * @param String|null $content * * […]

Check if do_action('custom_action') is hooked into?

Is there a way to check if a custom hook gets called upon? I would like to display a placeholder if no output will be passed to it.

Wp_update_post: Infinite loop even with remove_action solution, OOP

I have a quite complex PHP class, reponsible for creating and printing meta_boxes, generating and saving meta fields, … Each meta_box (object of class) has its own save function, that updates meta data of post (fields for them are instances of another class) as well as its post_excerpt and post_content. Yep, it’s probably a little […]