Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

1
vote
0answers
16 views

Add media library tab

I'm trying to make a new tab in the media library. I have found the function add_media_page which helps me add a page in the media menu to the left. How ever, this menu is not always visible, for ...
1
vote
0answers
22 views

put custom taxonomy slug in front of their respective term slugs

I needed to register two custom taxonomies which partly share some terms. The structure would look like this, when commerce and crafting are two different custom taxonomies: Commerce Furniture ...
1
vote
0answers
67 views

Get log of function/method calls made by do_action() on WordPress initialization

Is there any way I can get a log of the method calls that are made when do_action( 'init') is fired?
1
vote
0answers
914 views

How to set a custom path, for ajax image upload folder in admin?

I am coding my first Wordpress plugin that handles some data for a custom (shop-like) post type. It also has an image uploader within a metabox, where you simply drag in your images and it ...
1
vote
0answers
42 views

PHP header() gives headers already sent

I am working on a checkout proces in Wordpress where if customer clicks on the checkout button he gets redirected to a payment provider. Important to know: I use a session in this proces. I use PHP ...
1
vote
0answers
118 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: ...
1
vote
0answers
93 views

I have 2 plugins using the same wp_login action hook and one is not working

so this is after a few hours investigating, I have s2member plugin and a custom plugin what happens is they are both using wp_login hook in this manner, s2member: add_action("wp_login", ...
1
vote
0answers
64 views

Add custom text in the media library image meta area

I want to add some custom text in this area in the media library: Is there a filter I could hook into or how can I add content there? If not, how do we do this using Javascript? I want the text to ...
1
vote
0answers
63 views

Issue understanding and using WordPress filters and actions

I have a custom WordPress plugin that I have developed. The plugin is a widget bundle containing a bunch of custom widgets. The scenerio The plugin allows for custom css styles through creating a ...
1
vote
0answers
111 views

Show message in media-new.php

I'm wondering if there's a way to show a specific message when user uploads a file using the wp-admin/media-new.php script. So far I have this: function my_uploads_notice(){ global $pagenow; ...
1
vote
0answers
43 views

Hooks are not being removed in child theme

I have a hook file: function load_admin_package(){ do_action('load_admin_package'); } /* * ----------------------------------- * Define hooks bellow * ----------------------------------- */ ...
1
vote
0answers
33 views

How to hook into unregistering a widget instance?

I would like to hook into a widget instance after it is removed from a sidebar panel on the Appearances -> Widgets admin page. So if the instance was an active widget and then removed, I would like ...
1
vote
0answers
102 views

Firing a function AFTER redirect

I am using a function that redirects the user to a custom page, rather than wp-login in the event of errors. In my case I am using the Http Referer function to send the user back to the same page ...
1
vote
0answers
85 views

Copy post to separate database with “add_action(…)”

I'm basically trying to have a copy of a post be sent to another database's table when it's published. I've gotten it to add a new row in the new table, with my own static arguments, but I'm not sure ...
1
vote
0answers
177 views

Hook into existing tinyMCE button

Is there a way to hook into an existing tinyMCE editor button? I have a plugin that currently has a button on the editor and it shows a popup-box when clicked. This box has tabs inside. I would like ...
1
vote
0answers
66 views

Add a new confirmation page before saving

I'm going to add a hook that does some modifications of the text before saving. Before making the changes permanent, I would like the user to confirm the changes after a "save_post" hook. Is there a ...
1
vote
0answers
114 views

Featured image upload finished hook

I'm looking for a way to hook into the process of uploading a featured image. Ideally I would want to be able to do some stuff right when the upload has finished, before the thumbnails are generated. ...
1
vote
0answers
80 views

Can I hook into wp_update_core outside of the admin?

I'm trying to bring some of the admin functionality to a custom front end in WordPress. Questions of security and pragmatism of this aside, is there an available hook to trigger wp_update_core outside ...
0
votes
0answers
5 views

custom forgotpassword and hook for additional function

I have other app and a wordpress, whenever if there is a lost password request in the wordpress, it will also trigger for lost password request and other function for the app API.. the password ...
0
votes
0answers
9 views

Using init hook for register_taxonomy is causing invalid_taxonomy in wp_insert_term()

I'm developing a plugin and I've problem with inserting new term to my custom taxonomy. <?php add_action('init', 'create_tax', 0); function create_tax() { $args = array(...); ...
0
votes
0answers
11 views

Manage users custom column add class “num”

I have customized my admin users column to show the purchased leads of a role "lead buyer". The value of the column is a decimal (the number of leads). The "posts" column of the users table has a ...
0
votes
0answers
5 views

How to create a hook that can give points for either how many pages viewed by user, or pages viewed by a user's posts?

I started a blog recently and I liked the achievements idea. I installed two plugins both which I like, one is called Achievements and the other is called WordPoints. Specifically, I would like to ...
0
votes
0answers
25 views

Best Way to get facebook share count and update using wp_schedule_event or any other method

I recently developed a news blog, and my client needs facebook share count. I Successfully able to get the share count and update the custom field using below code.(with the help of cybermeta). What ...
0
votes
0answers
16 views

How might one programmatically set the link for all images in all posts?

Every post on my Wordpress site contains at least one image (in the content, not as an attachment). Each post also contains a custom field with a URL. I'd like to programmatically modify all posts ...
0
votes
0answers
22 views

Object oriented programming, add_action in constructor not firing

I am trying to write a class that adds an action to the save_post hook, but the post_updated function never gets called. I tried some variations, but it never gets called. Am I doing something wrong? ...
0
votes
0answers
12 views

Displaying randomly created meta values in wysiwig editor

I have already asked this question on stack overflow but I'm asking it once again here because i haven't found a solution to it yet. I am creating custom meta info for a post that will have null ...
0
votes
0answers
19 views

add_action - $function_to_add first argument defaults overwritten

I have an issue with the following code, $function_to_add first argument defaults are overwritten with an empty string "" and it cause an error: Warning: join(): Invalid arguments passed The second ...
0
votes
0answers
16 views

Prevent attachment from being deleted

In Wordpress admin media library page (upload.php) I'd like to do some checking on delete_attachment action. I want my custom function to fire before attachment's being deleted. In this function I ...
0
votes
0answers
46 views

How to `remove_action` from plugin

I'm using a third-party plugin that has an function hooked to the plugins_loaded hook. From the plugin file itself: add_action('plugins_loaded', 'acf_qtranslate_monkey_patch', 3); This is not in a ...
0
votes
0answers
29 views

How to call plugin function everytime

This is probably a very basic and simple matter, but what is the command to call a function in my plugin every time the page is loaded? I think it is something like add_action() or do_action(). ...
0
votes
0answers
7 views

Wrap template files of the parent theme

Is there a function or trick to put a wrapper to all template files. For example comments.php where the parent theme template looks like this: <div ...
0
votes
0answers
18 views

wp_get_referer function always returning false

I am trying to use wp_get_referer function along with "template_redirect" hook in wordpress like this function show_page_name() { $r = wp_get_referer(); var_dump($r); die(); } add_action ...
0
votes
0answers
19 views

Which hook should I use to generate title from custom profile fields

I have custom post types which do not use any standard fields, and have custom profile fields only. So, I want to generate a title based on a custom profile field, but I'm not sure which hook to use. ...
0
votes
0answers
19 views

Trigger needed when meta data is updated

I need to update a MySQL table (not any of the WP/Woo tables) when a products meta_key "_stock" is modified. The trigger needs to fire on all updates: shop sales, a CSV merge or edits by admin in the ...
0
votes
0answers
16 views

How to pass arguments with do_action to objects?

Passing arguments from do_action to objects added with: add_action('hook', array($obj, 'object_function')); does not work?
0
votes
0answers
50 views

Hook function on click of Button “Pages” in the WP Admin Panel / Not Activate Plugin

I need a hook which I can use for add_action('TheHookINeed', 'add_hooks_for_advanced_page_manager'); I need the function add_hooks_for_advanced_page_manager() executed before the page overview site ...
0
votes
0answers
31 views

do_action filter function from add_action array

I am looking at the following setup: -- Combing multiple functions into single action -- add_action( 'single_post_meta_start', array( $this, 'the_title' ), 10 ); add_action( ...
0
votes
0answers
34 views

How can I use a filter/hook to modify the URL passed in the content of an [embed] shortcode?

If I pass the [embed] shortcode an absolute URL that only includes the path (i.e. it starts with a slash and is hosted on the same server as the page itself), if it's a movie file, it doesn't ...
0
votes
0answers
22 views

Write Custom Access Control Code For WordPress Download Manager

The WordPress Download Manager plugin by default allow us to select which rule can access the file. But I have a special case, I want if the user have a meta date equal to specific value then the ...
0
votes
0answers
16 views

Run function after theme is installed for the first time

I want to run a function to add default widgets for my theme when it's installed for the first time. I tried add_action( 'after_switch_theme', 'add_theme_widgets' ); but it resets the widgets back to ...
0
votes
0answers
65 views

A correct hook for saving meta boxes data

Nothing happens when I do the var_dump() in a callback on post save. Here are the hooks I've tried: save_post as shown in the codex pre_post_update as suggested here wp_insert_post_data found in ...
0
votes
0answers
34 views

Unable to create custom table , register_activation_hook from class

Cannot create the table , what am i missing class em_db { public function em_events_custom_table() { global $wpdb; $table_name = $wpdb->prefix . "em_events_db"; ...
0
votes
0answers
34 views

calling a function from a class in your template

ok, so I have created a plugin in Wordpress. I want to be able to use some values I have created in a function within my template but I just don't seem to be able to get it to work. I have created my ...
0
votes
0answers
17 views

Customizing what happens when the user logs in - Hook or custom file?

I'm trying to get used to the S2 Members plugin and I am using it to build a membership based website. It's fairly simple stuff, but it's just to get used to working with the Framework and Wordpress. ...
0
votes
0answers
93 views

How to hook add_action('user_register', 'my_functon') only when manually adding?

I stumbled upon the following. In functions.php i have a hook which calls a function when a new user is registered: add_action('user_register','do-my-function') This works, but i have also a plugin ...
0
votes
0answers
32 views

save_post is not firing when I only edit custom meta fields

I've come across the action hook save_post few days back and I like to take advantage of it. I've custom post post type "Property" with Meta fields associated with it. The problem is that when I ...
0
votes
0answers
44 views

Add row counter in Admin area - Custom post list

Hi I add some custom columns to my custom post type listing in admin area. In my functions php: function book_cpt_columns($columns) { unset( $columns['date'] // Ocultar columna ...
0
votes
0answers
53 views

How to apply hook on pre_get_posts go get natural sort in listings in dashboard?

I have this code to do sorting on meta_key e_nummer ascending order in admin dashboard when listing products. /* Sort posts in wplist admin by e-nr! */ function custom_post_order($query){ ...
0
votes
0answers
301 views

admin-ajax.php not working after wordpress 4 update

n WordPress 3.9.2 access to admin-ajax was working for non loggedin users. When I upgraded the script stop working. I have the following code in functions.php function theme_name_scripts() { ...
0
votes
0answers
21 views

Override child theme menu to social menu

I have a header.php file contains these code supreme_primary_navigation(); do_action( 'after_menu_primary' ); and functions.php file contains these code function supreme_primary_navigation(){ ...