Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

0
votes
2answers
264 views

What is the action hook that deletes a taxonomy term from the backend? And how to retireve the term id before deleting it?

I need to delete some postmeta when deleting taxonomy terms from the backend. Before deleting the term, I need to retrieve the postmeta's meka_key and the term id that is going to be deleted. Use the ...
-1
votes
1answer
67 views

How can I get the term_id from the action hook 'set_object_terms'?

I have the following code and I want to use the term_id inside that function. I aware that the variable $terms contains the term; however, I do not know how to get the term id from it. ...
0
votes
0answers
12 views

Hook on Add new category from post editor [duplicate]

How can I "hook" on Add new category metabox from post editor page? I need to add some default values to DB when adding new category
1
vote
3answers
125 views

What are the benefit in adding hook in the init() hook?

I see a lot of plugins using this approach to add a new hook, e.g. add_action('init', function() { add_action('SOME_LATER_HOOK', xxx); add_filter('SOME_LATER_FILTER', yyy); }); Why they don't ...
1
vote
2answers
1k views

Include WooCommerce 2's prettyphoto scripts on all site pages

So when WooCommerce updated to version 2 they replaced the fancybox lightbox scripts with prettyphoto. I would like to use this on all my wordpress site's pages, not just the product pages, but the ...
0
votes
0answers
100 views

Custom login errors and redirect

I am working on a custom login page in Wordpress and found these 2 functions for a redirect back to the custom login pages to show errors there and nog on the Wordpress default login page. The first ...
-1
votes
1answer
438 views

How do I change TinyMCE button “i” to create a i tag rather than em?

I want to give the "italic" button back the "styling" behaviour, rather than the spammy <em>. I want that button to print a <i> tag, rather than <em>. <em> tags became popular ...
0
votes
0answers
17 views

Extra Editing Box in WP Dashboard

So I am trying to add an extra box in the WP post dashboard. In this box I will add a piece of HTML code. This code created the box in the WordPress area: $woo_metaboxes[] = array ( "name" => ...
0
votes
0answers
11 views

How to make the registration form as page [duplicate]

I am currently using 'Cimy User Extra Fields' plugin for adding extra fields on my registration form. But i want to move the whole registration form on a single page so i have all the website footer ...
0
votes
3answers
712 views

Theme Customizer not loading JS for live preview

I am currently working on adding options to the theme customizer. For the last two hours I have been trying to get the live preview working and I am trying figure out why my theme isn't loading the ...
-3
votes
1answer
37 views

Is there any Reference of Wordpress hook and hacks? [closed]

I am searching for a website to have lots of Wordpress hacks and hooks. Some hooks like activating debug mode or etc. Can you give me lots of this futures ?
0
votes
1answer
57 views

change output location of plugin function using a custom hook

I'm running the YouTube Video Fetcher plugin and it fetches youtube videos and displays it on your website. However, instead of displaying the video after the post, I want to hook the code into a ...
0
votes
1answer
24 views

Can my hooked uninstall class function access a global var declared in main plugin file?

My current setup is as follows... In the main plugin file, these two hooks are set (not inside any class): register_activation_hook(__FILE__, array('DG_Setup', 'activation')); ...
0
votes
1answer
222 views

disable publish button until condition is not met

I currently wrote a plugins to customize my wordpress website. I surprisly find it easy to do many things with hook. Now I want to make author not be able to push publish button if no category is ...
0
votes
0answers
69 views

Plugin action hook fires when it should not (unrelated admin screen)

I maintain a plugin which generates a PDF of a page or post when an icon or link is clicked. PDFs may be cached, and as such, when a page or post is edited, we refresh the cache by regenerating the ...
5
votes
2answers
2k views

Save_post for custom post type?

Is there a save_post hook for custom post types? example: save_my_post_type I know there is publish_my_post_type but I'm looking for a save hook.
1
vote
1answer
84 views

Filtering the post list in the admin area

How can I filter my custom post type like it's filtered by WordPress itself? By that I mean the links that allow you to show only published, private or trashed posts. I need it because I want to ...
1
vote
2answers
154 views

How to filter backend post list showing only posts having a shortcode

I need to filter the Posts and Pages tables in the Admin panel by certain shortcodes. In my plugin, I have added a column for shortcodes to the Posts and Pages views that works like the "Categories" ...
0
votes
0answers
55 views

Hide post completely and still reach it via cURL

I've been struggling with this for several hours. I want to have a post hidden from every listing, including the posts edit screen, and having it not reachable by browsing to it. I successfully did ...
0
votes
0answers
106 views

Populate WYSIWYG field with ACF choice

So, I have a custom post type that uses a flexible content field containing a post object field and a wysiwyg field. The post object is to choose a post from a selected post type. After you choose ...
0
votes
1answer
123 views

What is the use of wp_schedule_event hook?

I want to do a cron(executes function at specific time, like email,db backup etc) job. I searched in wordpress, i got this wp_schedule_event Here they say it will execute job when someone visits ...
1
vote
1answer
731 views

Is it possible to Hook/Filters Attachment Creation?

Is it possible to hook or filter the attachment creation process? More specifically is it possible to hook into the attachment creation so that I may parse the attachment’s filename, populate the ...
0
votes
1answer
50 views

Cannot override hooks.php

I building a child theme for 'Responsive Theme' from Cyberchimps. I would like to change one hook. So I guess I need hooks.php file in my child theme. So I copied it from the parent. I made the same ...
-1
votes
2answers
66 views

How to add a new link to the default register form's footer links?

I would like to add a custom link to the footer section of the register form. How can I do this? I am using the login_footer hook: add_action( 'login_footer',array($this, 'add_forum_menu'), 50, 2 ...
6
votes
4answers
3k views

Import Wordpress XML File from Within Functions.php

I am developing a theme which has a different method of adding in content and so, the default install of Wordpress won't show any content because of this. I was wondering if it is possible to ...
1
vote
1answer
48 views

How to find a callback attached to a bbpress hook?

bbpress has a large number of callbacks attached to various hooks. I am familiar with this feature at the wordpress level but I am unable to locate where bbpress registers a large number of these ...
1
vote
2answers
477 views

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.
0
votes
1answer
30 views

Set the default category of an attachment

I wanted to apply the same categories that exist for posts to attachments, so I wrote this code: function wpmediacategory_init() { register_taxonomy_for_object_type( 'category', 'attachment' ); } ...
0
votes
0answers
149 views

Adding custom Bulk Actions

I have been looking around for ways to add custom Bulk Actions to the categories page. Most of them say that it is impossible to do it in a clean way, because of the lack of a hook for this. Most of ...
1
vote
1answer
56 views

Posts are duplicating on wp_post_update

I have stucked in writing a simple function that on certain page update refresh all posts in a custom post type. Here is my code (based on this): add_action('save_post', 'bulk_refresh'); function ...
1
vote
3answers
7k views

Woocommerce Product Category Widget - hide categories that have no products in stock [closed]

I'm using WooCommerce on my Wordpress site, and have a widget in the sidebar showing all product categories. It's setup to hide empty categories, and that works well. However, it still shows ...
0
votes
1answer
131 views

How can I add a Custom Button to Add or Edit post / page next to Add Media?

I'm trying to add a custom button nearby the Add media on the wordpress Add and Edit Post/Page. How can I do that? Thank you very much for your help!
1
vote
0answers
82 views

How can I register a hook for all Custom Post Types that are published?

I'm developing a plugin. I want that when every Custom Post Type is published, a hook is called (where I send an email notification to the administrator). I know I can use: ...
0
votes
0answers
153 views

Can't update an option when the publish_post action is fired.

I'm using Tom McFarlin's Plugin Boilerplate, and I'm facing this huge problem where I can't update an option when the publish_post action is fired. I have a function that hooks into the publish post ...
0
votes
2answers
75 views

Override the Wordpress core function wp_referer_field

I'd like to override the core Wordpress function wp_referer_field to change the value of $referer_field variable inside of it. I've found that wp_referer_field is not pluggable and that I need to ...
0
votes
1answer
247 views

The Hook registration_errors was not called

I can't validate the custom fields in my plugin. I want to skip some registration on WordPress. My code snippet is here: add_filter( 'registration_errors', 'reg_user_register', 10, 3); function ...
1
vote
2answers
114 views

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.
0
votes
1answer
255 views

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 ...
0
votes
1answer
61 views

password_reset hook is not working

I am developing a plugin where a MySQL user is created with username same as WP-username and password is entered by user using form . Now If the user resets its password in WordPress then the same ...
1
vote
2answers
64 views

How to place HTML below the title of the (custom) post overview

Edit: Yes, I know, I provided an answer to this question myself. However, I'm still interested in other solutions and/or comments on the one I found. Is this how you would do this? Are there any other ...
0
votes
1answer
55 views

Is there a way to prevent a function/method from being called outside a specific hook?

I would like to make function only callable by a specific action, in this case the register_activation_hook() function. How can I do this?
-3
votes
2answers
654 views

Why does wp_enqueue_script ignore my 'wp_head' hook?

I would like css_head_scripts and js_head_scripts to be appended to wp-head but Wordpress completely ignores it? Am I missing something? function css_head_scripts() { wp_enqueue_style( ...
0
votes
0answers
53 views

Hook into trash_post_comments, update_user_meta

I have a theme where the author get points for posting posts and comments. When I trash a post, the user get 1 point removed from their score. This works fine with this function: However... When I ...
1
vote
1answer
133 views

new_to_publish fires multiple times

i have been trying to use draft_to_publish & new_to_publish to create an update when ever a post of a specific type (cpt) is published... it works but published 600+ times instead of one time! ...
0
votes
2answers
242 views

what is correct way to hook when update post

i try to hook when post is updated but all hook i try never executed except updated_post_meta add_action('updated_post_meta', 'my_function'); function my_function($post_id) { echo 'This is ...
0
votes
3answers
103 views

How to hook into publish_posttype?

I'm trying to hook into WordPress publish. The code below is what I'm using, but it doesn't appear to be running. I have it in a plugin file that I deactivate/reactivate each time I make changes ...
0
votes
0answers
53 views

Add class to all parent elements inside the_content

Is there a way to add a class to all parent elements inside the_content? My problem is I'm using this kind of css selector: .post_content>* {margin-bottom:10px;} This is to due with mostly ...
12
votes
5answers
3k views

How to include code only on specific pages?

I'm learning about plugins and shortcodes. I noticed that when I activate my plugin its code gets loaded on all of my pages-- even pages that don't have my shortcode. (I don't mean content vs. admin ...
0
votes
0answers
70 views

Displaying Single Future Posts in a specific Category or Taxonomy

I want posts that are tagged with a certain term and scheduled to be posted some time in the future to be publicly available. So if I create a post, assign it a special term (category, tag, custom ...
0
votes
0answers
35 views

admin insert media pop up hooks

I want to add the url to a specific image size in the add media (clicking the add media button in the post). At the moment I am adding the image to the post and getting the url and grabbing the url ...