Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

1
vote
3answers
124 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 ...
0
votes
0answers
80 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 ...
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
10 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 ...
1
vote
1answer
90 views

Move excerpt meta box to above content editor

I found a WordPress hook called "edit_form_after_title" to add a text box after the title. How can I use this hook to display the excerpt after the title while creating a new post?
-3
votes
1answer
36 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
49 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
22 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
0answers
66 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 ...
0
votes
1answer
147 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 ...
1
vote
2answers
95 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
48 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
93 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
100 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 ...
0
votes
1answer
41 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
57 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 ...
1
vote
1answer
40 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
228 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
23 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
78 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
42 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 ...
0
votes
1answer
83 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
68 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
2answers
57 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 ...
1
vote
2answers
95 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
156 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
54 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 ...
0
votes
1answer
178 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 ...
-3
votes
2answers
373 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
1answer
47 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?
1
vote
1answer
75 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
125 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
0answers
41 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 ...
0
votes
0answers
36 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 ...
0
votes
0answers
49 views

WordPress Visual Editor Filter for Visual View

I have setup custom HTML to be created when a user inserts media using "Add Media" in WordPress using the code below: add_filter('get_image_tag', 'add_image_frames', 10, 6); function ...
0
votes
0answers
63 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
28 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 ...
0
votes
0answers
13 views

Use admin notices to show errors [duplicate]

I'm using the transition_post_status hook to perform some operations after publishing a post. If an error occurs, I would like to use the admin notices to show a message to the user: ...
0
votes
2answers
388 views

How to show an error message after publishing a post?

I'm using the transition_post_status hook to perform some operations after publishing a post. In some conditions I would like to show an error message in a red box under "Edit Post" and above "Post ...
1
vote
2answers
63 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 ...
1
vote
1answer
74 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 ...
0
votes
1answer
38 views

How do I amend form data before it is saved for a custom post type

I have a custom post type for clinics which has 3 fields; a textarea for the address of a the clinic and two textboxes for latitude and longitude. I want the user to enter the address in the textarea ...
0
votes
1answer
63 views

save_post not working

In order to create (or update, whenever a post is updated) a unix-timestamp meta, I used following code to fire on save_post. I pasted this code in functions.php. But I believe this is not working, ...
1
vote
1answer
37 views

When does a function assigned to the content_filtered_edit_pre filter hook fire?

I added a function to the filter hook tag 'content_filtered_edit_pre', but it doesn't seem to fire no matter what I do. I am also aware of 'content_edit_pre', but I am curious as to when this filter ...
0
votes
0answers
38 views

Plugin constructor called multiple times

I have plugin with the following structure - class emailPlg { static $tableName; static $pluginDbVersion = 1.0; function __construct() { global $wpdb; ...
2
votes
1answer
108 views

Check php version before theme activation

I've got theme that requires php 5.3+ version. If older - fatal error occurs with it. So what I need to do when user try to activate this theme is to check php version before going into theme code ...
0
votes
1answer
46 views

How do I remove an action hook by s2member

I noticed that my plugin doesnt work when s2member is activated but unfortunately it is needed for the site functionality, i did some research if I comment out this line on hooks.inc.php then my ...
0
votes
1answer
29 views

Renaming wordpress login and get new password button

I am currently building custom wordpress admin login theme.Now I have an idea but not sure it is possible.I want to rename "Get New Password" to something "Get New". Is it also possible to rename "Log ...
0
votes
2answers
106 views

Why I can't load my JavaScripts using an hook inside my functions.php file?

I am pretty new in WP (I came from Joomla) and I have the following problem: I am carrying this pure HTML theme (that use BootStrap CSS framework) into a WordPress theme. This is the original pure ...
0
votes
1answer
50 views

Removing action from template class

I'd like to replace an action in a theme with my own version in a child. In this case, the theme hooks into wp_head to add it's own links. My own functions.php resides in the child theme and looks ...