The tag has no wiki summary.

learn more… | top users | synonyms

6
votes
1answer
2k 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
33 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 ...
0
votes
1answer
22 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
48 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 ...
0
votes
2answers
82 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 ...
1
vote
1answer
508 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
213 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
37 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 ...
0
votes
0answers
22 views

Set up the link in a reply to the parent comment?

I'm styling chronological order comments. I found this snip on this WordPress Answers site from here comment_reply_link( array_merge( $args, array( 'reply_text' => __( ...
5
votes
1answer
300 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: ...
0
votes
1answer
224 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
117 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
154 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 ...
0
votes
1answer
32 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
170 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
540 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
163 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
454 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
0answers
25 views

How to get a RestFUL URL for a function?

I have a basic custom function which accept GET/POST requests, and process them upon request. Just simply (Lets say GET now): function miccheck() { echo "Hello, Mic Check 123! ". ...
0
votes
0answers
8 views

Is it possible to pass custom args to action/filter callback functions? [duplicate]

I am filtering the Where clause with the filter hook "posts_where" and I would like to pass a custom argument to the callback function. Because I don't know how to do that yet, I am adding the filter ...
4
votes
3answers
1k 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
2answers
1k 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
46 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 ...
6
votes
2answers
284 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
79 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
69 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
322 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
247 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', ...
2
votes
2answers
652 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
107 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
228 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: ...
1
vote
1answer
494 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
118 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
761 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
117 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 ...
0
votes
2answers
1k 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
640 views

How to Override default update_count_callback for category

Is it possible to override default update_count_callback for category? The default function counts published posts while I want to count private posts. I do not want to register a new taxonomy.
0
votes
1answer
1k views

Update term count using a callback function

With the wp_update_term_count_now, how can I use the update_count_callback to specify my own count. I need to include counts from another database that the current database category is able to ...
0
votes
1answer
239 views

Where is this function's callback getting its arguments from?

This might be better suited to Stack Overflow, thought I'd try here first though. I was walking through this tutorial by Justin Tadlock and encountered the function below being used as the callback ...
1
vote
1answer
818 views

Multiple options pages validation for a plugin

I am writing a plugin and I decided to have multiple pages for different options of the plugin (for clarity's sake). Doing a single option was a piece of cake, but I'm encountering difficulties when ...
3
votes
3answers
2k views

How do I hook an Ajax request into a PHP callback?

Following the directions here http://codex.wordpress.org/AJAX_in_Plugins#Ajax_on_the_Administration_Side I wrote this code: EDITED TO INCLUDE DIE(), STILL NOT WORKING function my_button() { echo ...
1
vote
1answer
139 views

Wordpress Custom Menus Issue

In my template I'm using calls like this to output some custom menus: <?php wp_nav_menu(array('container_class' => 'secondary-navigation', 'theme_location' => 'secondary')); ?> Ever ...
0
votes
1answer
581 views

Replacement for gallery_shortcode function not taking all attributes

I have the following custom function to replace the gallery_shortcode function from core. It hooks in at the beginning and works. The problem is that I can't get my custom key/values from the ...
2
votes
2answers
261 views

How do I use the control callback when creating a simple dashboard plugin

On this page: http://codex.wordpress.org/Function_Reference/wp_add_dashboard_widget The function wp_add_dashboard_widget is described. It states: wp_add_dashboard_widget($widget_id, $widget_name, ...
0
votes
1answer
552 views

Using call_user_func() within add_settings_section() within a Class

I am trying to add_settings_section() by supplying a callback with parameter as follows: class warpress_progression_plugin { function warpress_progression_plugin() { $this->__construct(); ...