The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
0answers
31 views

wordpress admin-ajax returns 0, what I do wrong?

I have no clue why my callback function is not fired, thus I got 0 as a response of admin-ajax.php. My main plugin file looks like this: require_once( BLUECARROT_DIR . 'class_bluecarrot_user.php' ); ...
0
votes
1answer
17 views

register_settings callback function erases data

I have registered a setting with a callback function: register_setting( 'my-plugin-settings-group', 'notification_email', 'email_validation' ) and callback function looks like: function ...
0
votes
1answer
78 views

Warning: call_user_func() expects parameter 1 to be a valid callback, function

I keep getting this error when. I am trying to insert a dashboard widget and I don't know what's causing the error. Warning: call_user_func() expects parameter 1 to be a valid callback, function ...
0
votes
1answer
23 views

custom-background callback breaks media uploader

I've added theme support for a custom background/color along with a callback and it seems to be breaking my media uploader, as while the uploader box appears, uploads result in an error and image ...
0
votes
1answer
119 views

Retrieve post in AJAX Callback

I have a JS file that triggers a PHP callback file. The PHP file is supposed to work on the Post that is currently opened (wp-admin/post.php). I do not want the JS file to pass the post id though ...
3
votes
5answers
7k views

wp enqueue script using scripts from cdn with a safety callback

I want to include several scripts and styles from a remote CDN... in this case bootstrap and similer files but i want to provide a safety net in the form of a callback in the case the CDN is down for ...
0
votes
2answers
80 views

Customiser sections not being displayed with `active_callback`

I've added several customisation options to my theme, and I'm (trying to) use the active_callback argument with $wp_customiser->add_section(). In the first instance, this appears to be working ...
0
votes
1answer
730 views

Callback URL in WordPress

I want to use this service OnWebChange to monitor when a website changes and change mine accordingly. It would notify me via a URL callback to my website URL with a HTTP POST method. What tools/API/...
0
votes
3answers
692 views

Ajax insert or update data

I've been browsing through similar questions and have yet to get this functionality to work. I'm tracking the progress a user makes an embedded vimeo video and insert data or update data. JS on the ...
0
votes
1answer
119 views

Custom Sanitation Function Triggering an Alert in Customizer?

I have an image upload field in theme-customizer : /* Background Image */ $wp_customize->add_setting( 'tcx_background_image', array( 'default' => '', 'transport' ...
2
votes
1answer
232 views

How to get control choices from $setting object passed to sanitize_callback

Example Code Working with the Customizer API. Setting added (example) like so: $wp_customize->add_setting( 'theme_oenology_options[' . $option_parameter['name'] . ']', array( '...
0
votes
1answer
246 views

How to return multiple arguments from AJAX callback function

First of all, please don't mark the question as duplicate as I didn't ask how to send arguments with ajax request. I want to receive some extra arguments on ajax success. My callback function will ...
0
votes
1answer
46 views

Problem with Class, Filters and Callbacks

according to this Callback example if I'm referencing a method inside a class, I should use add_filter by specifying an array with 2 elements, first the object then the method. Here is my code: ...
4
votes
4answers
2k views

Add_settings_field() parameterizing callback?

I'm trying to create a rather large and extensive settings page with various options of very similar type. Since there will be about 20 different fields, and the differences between most of those ...
0
votes
1answer
36 views

How can i call a custom method on submission of a custom plugin post type?

I have registered a custom post type .On submission of that page/ post can i call a custom method . How ? Can i add a method in plugin file and will it call on post type submission by ACF or any ...
0
votes
1answer
89 views

remove_action: Initial attempt failed while a later attempt worked

I hope this is the right place to post this - if not, please just simply direct me to the right place! I recently came across a plugin that, among other things, added a meta entry to the header. I ...
1
vote
1answer
249 views

default callback function in wp_list_comments

Which default callback function wp_list_comments use if I don't set callback parameter? I saw in the code of this function but I can't understand it.
0
votes
2answers
2k views

url - ajax loaded but no JS

I have this url to call the taxonomy.php by pressing the button with the code beneath to show filtered posts: http://myurl/?meta_key=post_views_count&orderby=meta_value&order=ASC This is ...
0
votes
1answer
226 views

What is the callback sent to add_submenu_page() invoked by WordPress?

WordPress tries to be event driven with all it's actions and filters you can hook to. But it also has special functions to create admin pages such as add_submenu_page() which accepts a (callback) $...
9
votes
1answer
5k views

How to pass arguments from add_settings_field() to the callback function?

I have a function like this: add_settings_field( 'contact_phone', 'Contact Phone', 'settings_callback', 'general'); That works. It calls settings_callback. Cool. The problem I have with this is: ...
0
votes
1answer
461 views

Hook into admin_notices after sending mail

In my (admin) plugin I want to display a message using admin_notices action on successful sending of mail. Currently it is not displaying. I know this has something to do with the order of events, but ...
2
votes
1answer
769 views

Using a private method as an action callback from within a class

I have created a class from within which I would like to call a private method (from within the same class) from the __construct method as an action callback. When I would like to use a public method ...
0
votes
0answers
81 views

call user func array error after moved the site to new server

my wordpress site moved to a new server with cpanel. now after logged into wp-admin an error is showing. call_user_func_array() expects parameter 1 to be a valid callback, function 'showEntry' not ...
1
vote
1answer
1k views

How to define a callback for an URI?

I have a function in functions.php like so: function myplugin_mycallback($id) { // do something } I want this function called whenever a URL like myplugin/mycallback/xxx is accessed. How/where ...
2
votes
2answers
434 views

wp_insert_post() Callback?

After I added a post by wp_insert_post(); Any callback after I added ? I need permalink of added post. I have idea only search by title and post-type (I use custom post-type in my case), But any ...
1
vote
0answers
109 views

Admin ajax add tag callback

Is it possible to add an additional callback to admin ajax? Basically, I'm trying to increment the value in an input field of the add form for a custom term after the form is submitted. After the form ...
5
votes
1answer
826 views

Image upload callback in new 3.5 media

I am using new 3.5 media uploader in my theme frontend (base on this example). It is very simple when you want to do something with images after the 'Select' button is pressed: file_frame.on('select',...
0
votes
1answer
237 views

Default Gravatar not showing for pings

Here is my comments block: <div id="comments"> <?php if (have_comments()) : ?> <h3><?php printf(_n('1 comment', '%1$s comments', get_comments_number()), ...
1
vote
1answer
478 views

Shortcode callback for add_action('wp_footer')

I am trying to build a Google Maps shortcode using the gMap plugin from Github, not a plain iframe. For which I have to echo a custom inline script for EACH shortcode, right before the closing body ...
0
votes
0answers
381 views

Infinite scroll jPlayer callback with PHP and post id?

How can I call the correct callback function for infinite scroll plugin on WordPress with variable <?php the_ID() ?> ? I'm trying to connect jPlayer like this: Code in php: <script type="...
0
votes
1answer
43 views

Plugin default settings hook

I am writing a plugin where I want it's default settings to change in accordance to the theme that is selected. I have it working, but would rather provide an action hook for this instead of writing ...
0
votes
1answer
643 views

Is it possible to create an action hook using do_action() within add_action()?

Is it possible to create a new action hook like do_action('my-hook-name'); inside a call to add_action();? I'm aware this code doesn't work, but I was thinking something along the lines of... ...
0
votes
1answer
3k views

ob_get_clean returns empty string, ob_get_flush outputs string

I am utilizing a template-type system, to filter the_content. My filter contains this partial code: ob_start(); include_once ( self::$dir . 'views/templates/' . $post_type . '/' . $display . '.php' );...
0
votes
0answers
388 views

First argument is expected to be a valid callback for cp_admin_init and _canonical_charset

I'm using WordPress 3.5 with child-theme of Twenty Eleven 1.5. Suddenly I'm getting following Warning, Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to ...
0
votes
1answer
3k views

PHP Warning: call_user_func() expects parameter 1 to be a valid callback

Confused. Writing a plugin with which I have other callbacks working similarly fine. But when adding a meta box its failing on the callback with error: PHP Warning: call_user_func() expects ...
0
votes
2answers
2k views

replace current_page_item class in menu

I want to replace below class with active class in menu: .current-menu-item and .current_page_item I am already using a menu callback which add a class dropdown in child menu: class ...
0
votes
1answer
54 views

Category callback box problem

I am using Ciola theme from Theme forest and this is my site: http://www.gazetaswietojanska.org/pomorzekultury/. I have an issue concerning category callback on the homepage. As you can see, there are ...
7
votes
2answers
519 views

current_shortcode() - detect currently used shortcode

In a plugin class I want to provide simple fields for public data: email, phone number, Twitter etc. The list can be extended. See the plugin Public Contact Data on GitHub for details. To keep the ...
0
votes
1answer
337 views

How to return hook data when multiple parameters are present?

What is the proper way of returning data to a hook when there is more than one parameter present? Example apply_filters('image_downsize', false, $attachment->ID, $size) Attaching a callback ...
0
votes
2answers
101 views

Reference external file as a function

In my functions.php I have the following code: add_action( 'admin_menu', 'jp_create_admin_pages' ); function jp_create_admin_pages() { add_menu_page( 'Members', 'Members', ...
2
votes
1answer
1k views

How can one utilize a variable as a callback function name for add_settings_field

I'm trying to cut down on the amount of code that is in my theme options function. I'm adding my settings like so: add_settings_field($k,$v,$callback,$the_options,$the_group,$args); This works for ...
1
vote
1answer
658 views

How to validate register settings array

I would like to know how to perform a proper validation with the register_setting() callback function. Here is a sample part of my code I want to work with: register_setting( 'wpPart_options', '...
0
votes
1answer
35 views

Meta boxes not showing up

Okay so I'm trying to render a meta box. This is what I have so far, trying to keep it as basic as possible: add_action('load-post.php', 'ad_templates_callback' ); add_action('load-post-new.php', '...
3
votes
2answers
1k views

Can an action callback prevent the parent from continuing execution?

I'm working on a plugin that interacts with Gravity Forms, and under certain conditions I want to prevent a form from being deleted. Here's the method in Gravity Forms that handles deleting a form: ...
0
votes
1answer
118 views

How do i specify a url to which to redirect the user after he logs out from facebook?

I need to specify a url that i will use after the user has logged out from facebook because i need to do some extra-cleaning and he is correctly logged out from our app. For this i need a url that ...
0
votes
2answers
366 views

Filter an array with a callback - for single & multidimensional arrays

I've a filter attached, that allows modifying an array: $data = apply_filters( 'wpse_example_filter', $data ); The problem is, that the data can be a single or multidimensional array: // single: '...
2
votes
1answer
939 views

settings API: how to create a multi checkbox with blog categories?

i need to create a callback function with a multi checkbox with all the web/blog categories as multi options. my add_settings_fields are: add_settings_field( 'select_page', ...
0
votes
1answer
143 views

Rewrite rule to redirect to a particular filename.php

I'm using the Monkeyman Rewrite Analyzer plugin (http://wordpress.org/extend/plugins/monkeyman-rewrite-analyzer/) I want to write a rule that will be take a URL (that is specified in the user's accnt ...
0
votes
1answer
2k views

How to pass variable via $callback_args for add_meta_box

I trying to pass some variable to the callback function through add_meta_box. Knowing that there is $callback_args that can be use to pass the variable. But somehow I just can't get it work within a ...
0
votes
1answer
179 views

esc_url not working within add_settings_field callback

I'm trying to display a saved option of a url inside a text input on my themes' options page, but it's just simply not displaying. I've checked the database and my url is saved using the specified ...