The callbacks tag has no wiki summary.
0
votes
1answer
24 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
40 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
40 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 ...
2
votes
0answers
47 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 'Select' button is pressed:
file_frame.on('select', ...
0
votes
0answers
35 views
GD Star Rating and Infinite Scroll callback
I'm looking to use GD Star Rating on a page that uses Infinite Scroll. However when loading the next section of the posts, the star rating looses it's functionality.
I've found easy callbacks for ...
0
votes
1answer
66 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 ...
1
vote
1answer
58 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
28 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', ...
1
vote
2answers
95 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 ...
0
votes
0answers
42 views
trying to add several meta boxes and when callbacks are called there is an error [closed]
I am making a plugin that adds meta boxes to post. i have a function that currently defines 3 meta boxes. now when i define the callback that prints the mockup there seems to be a problem
I get the ...
0
votes
1answer
83 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
291 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
2answers
89 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:
...
0
votes
1answer
76 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 ...
1
vote
1answer
247 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
2answers
491 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
87 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
1answer
305 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.
1
vote
1answer
176 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 ...
0
votes
1answer
97 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 ...
5
votes
1answer
183 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 ...
2
votes
2answers
403 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:
...
1
vote
1answer
588 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
1k 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
...
0
votes
1answer
889 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 ...
1
vote
1answer
104 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 ...
3
votes
1answer
537 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: ...
4
votes
2answers
824 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
459 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
202 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
195 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()), ...
0
votes
1answer
397 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();
...