Tagged Questions

Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

0
votes
0answers
12 views

Override an advanced custom fields action callback [duplicate]

I'm in the process of writing a CDN plugin for WordPress and am trying to integrate it with the Advanced Custom Fields plugin. I need to filter the output of the "File" field type on the edit post ...
0
votes
1answer
19 views

Use a variable created in get_header to calculate stuff in wp_footer

i am trying to create a small time tester that loads at get_header hook and the using the value does something in wp_footer... i have tried using global $var i tried putting the global var inside ...
6
votes
1answer
50 views

Add a new tab to Wordpress Plugin install Listing

When an user searches for a plugin from the WP Admin's Add Plugin area, I want to add a new tab(with a link to a page) next to the current tabs. The location where I want the link is marked in the ...
3
votes
1answer
43 views

How to add a link to Wordpress Plugin install Listing

When an user searches for a plugin from the WP Admin's Add Plugin area, I want to add a link/button to every plugin's listing area. Which hook should I use? The location where I want the link is ...
0
votes
0answers
15 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
1answer
19 views

Add custom message to the plugins page of Wordpress

I'd like to add a banner at the top of the plugins page (where you update plugins) that reads "Please do not update plugins". I know I can use the admin_notices hook to attach the message, but how do ...
0
votes
1answer
19 views

Where is publish_post hook fired?

Hook publish_post, which does not necessary need to be run on post publishing only, it can be used for any post type and any post status in this format {status}_{post_type} which also makes it hard to ...
0
votes
0answers
21 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
64 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
1answer
24 views

How to initialize something in unit test before the init hook being called?

I've a simple PHP Unit written for WordPress and want the initialize code before the main 'init' action being called from the plugin I want to test, e.g. class MyPlugin_Test_Example extends ...
0
votes
1answer
23 views

“Seen by” Feature in posts [closed]

Do you guess how would be a good practice to achieve a "seen by" feature in every post? I mean, simply add which users have seen a post. I'm not sure how to add a hook for that. Neither if I would ...
0
votes
0answers
11 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(){ ...
3
votes
3answers
145 views

wordpress hooks run sequence

What is Wordpress HOOKS execution consequence? I mean, i want to know the order, how add_action hooks are executed (i.e. init after_theme_setup wp_header and etc.. i want to know the correct ...
0
votes
1answer
34 views

Hook when adding or editing a specific custom post type? [closed]

I'd like to insert a script and if possible some PHP for a custom post type. I'm looking for a hook to do this on the add new or edit screens. Any idea what I'd use for this? I tried "edit_post" but ...
1
vote
0answers
14 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 ...
0
votes
0answers
23 views

Add notice to add image popup

I have been using the global "pagenow" variable to add instructions for users, but I need to somehow hook into the add image popup as I would like to instruct the users on optimal resolution for ...
1
vote
1answer
43 views

Conditional hook [closed]

Is it possible to have a conditional hook in my child theme function.php? This is because I only want a certain hook to execute when a certain criteria exists. I have tried doing the following code ...
0
votes
1answer
36 views

Bind a function with its own argument to show something dynamically after every content

I have a function that is grabbing something from database using a user-defined ID. I need to show the content after every post/page content. So I followed @s_ha_dum's solution from WPSE, like below: ...
0
votes
0answers
14 views

Comments closed only for contributors

I am having a very funny issue right now. My WordPress is currently with comments activated and it always worked, but now that I've opened the website for contributors, only their posts are coming ...
0
votes
0answers
19 views

Get post titles shows on single posts

I want to display this link lists in "single post" only. How to do this? add_action( 'genesis_before_footer', 'radiolink_unit', 1 ); function radiolink_unit() { ?> <div id="languagelinks"> ...
0
votes
2answers
31 views

Call Web Services on post first publish

I want to call some web service when i publish a post. I want to add a checkbox so as to decide whether to call or not call after publishing. I have found the code to call both REST and SOAP web ...
3
votes
1answer
64 views

Is it possible to save/modify a post without calling the “save_post” action hook?

There is a save_post hook that is run when you save a post. In fact, revisions and autosaves also call this hook. Even if you simply change the status from published to draft it triggers the save_post ...
1
vote
1answer
31 views

Are posts updated or built from revisions + autosaves?

When editing a post in the admin I see records being added to the database to document my changes (here is part of the hooks I'm logging): ... http://local.dev/151-autosave-v1/ clean_post_cache ...
0
votes
0answers
13 views

comment_post and preprocess_comment connected

In my comment_form arguments i add a input label with a value: 'comment_notes_after' => '<div id="canvasDiv" ></div> <script type="text/javascript"> ...
0
votes
1answer
37 views

Admin first hook that outputs HTML?

I think load-(page) is the first hook in the admin screen that deals with outputting HTML, but I'm not totally sure. Basically I'm looking for the equivalent to template_rediect or get_header, which ...
1
vote
1answer
24 views

Add parameter (time) to oembed

I need to add a time parameter to the YouTube oEmbed callback. This time parameter should be set via URL. I found various answers which describe how to hook into the oEmbed callback, but none of them ...
1
vote
1answer
57 views

How to modify an add_action() inside a loop of core function

Ok I want to edit bp_core_screen_signup() is which is a function of buddypress that used to process the registration form. Basically this funtion checks for any errors produced and then loops through ...
1
vote
0answers
28 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?
0
votes
1answer
42 views

change attachment custom field onChange event

The form is in post creating window. Ajax is posting values, but the values doenst renews. Where can be problem ? Ajax <script> function dynamic_Select(field, aid, value) { ...
0
votes
0answers
19 views

attachment custom values are'nt inserted to database

I have created attachment custom field. After I uploading image and inserting to new-post.php (post creating window) no meta values are saved in database. Even that I have set a default value for ...
0
votes
1answer
27 views

A good hook to check authorization and redirect?

It seems strange to put a redirect in a template page, because so much of the page has already been built by the time you reach a custom page template. I'm wondering what is a good action hook to use ...
0
votes
0answers
19 views

template_redirect and title

I pass a template_redirect in wordpress as hook but I want to have a personnalized title for this page and I miss to do that. Has someone any idea ? add_action( 'template_redirect', 'virtual_pages' ...
0
votes
1answer
192 views

Plugin hook breaks new WP 4.0 media library grid view?

I have a plugin which has code in it which has broken the new WP 4.0 media library grid view. The grid view itself (the rest of the page is fine) won't display if my plugin is active and this option ...
2
votes
1answer
52 views

How to properly test a method that is called by an action hook

The constructor in my class adds an action to the 'init' action hook: class My_Custom_Post_Type { function __construct( $type ) { $this->type = $type; add_action( 'init', ...
0
votes
1answer
39 views

How to increase password requirements for registration [closed]

Ok I have buddypress installed which lets users choose a password at registration but it has zero requirements for it only asking that it be entered twice. So you can have a single character password ...
0
votes
0answers
59 views

Editor/TinyMCE - change double enter key to <br /> and single enter to nothing

I have learned over the last year on Stack Overflow that people here prefer I give all details in the beginning instead of answering 12 comments worth of this stuff later. EDIT: If you don't want to ...
0
votes
1answer
31 views

Add Different Actions To Different Page's wp_footer

I am trying to add functions to wp_footer based on the the page id. I am hooking my callback to init, but its not working. Here is what I am using. function fl_template_loader() { if ( is_page( ...
0
votes
1answer
70 views

Custom form action hook

I am writting a simple newsletter subscriber plugin. I created a widget with form: echo '<form action="'.home_url().'" method="post" name="subscriber_form">'; echo '<p><input ...
0
votes
1answer
25 views

Is it possible to be more page/post specific with admin_enqueue_script?

I am using this code to load a stylesheet in the admin, but only on post.php related pages: function my_enqueue_for_post_pages_only($hook) { if( 'post.php' != $hook ) return; ...
0
votes
1answer
42 views

How to change home or site url using action hooks or filter?

I want to change url dynamically, so is there any way to change url? I know other methods like from admin, directly from database or wp-config. but i want to change it from either hooks or filter. ...
0
votes
0answers
34 views

Hook pages by id on static front-page

I would like to build a one page website upon the Wordpress CMS. I'm looking for a way too hook my pages on a static frontpage by id, since I have several page types. I've tried: $id=6; $post = ...
0
votes
0answers
19 views

Appropriate hook for filtering the posts from the admin page

I am currently developing a custom post type and I would like to know which hook I should use in order to filter posts by category. Can anyone please tell me how to do this?
2
votes
2answers
61 views

How to make post and comment count unclickable with dashboard_glance_items hook

I have a multi author site and I have already used some hooks to stop them from viewing other author's posts and media. Now, in the Wordpress Dashboard in the "at a glance" section it shows them the ...
0
votes
0answers
19 views

Automatically create featured image on post publish

I know how to make an image display IN PLACE OF a featured image if the post has no featured image, however, as far as the database is concerned, the post still has no featured image. In my theme, ...
5
votes
1answer
42 views

Wordpress Multisite: Adding actions to only one site

I have Wordpress Multisite installed with WooCommerce network activated. I want to add an action to a hook in ONE of the sites that has WooCommerce installed, instead of all of them. For example, I ...
0
votes
0answers
18 views

Removing WP-Login inputs

I'm building a passive captcha system for my WP sites, and I'm attempting to remove the inputs (username, password, submit) from my standard WP-Login page via php hooks; they'll be replaced via jQuery ...
0
votes
0answers
64 views

Add icon near meta box title in posts/pages

I'm trying to add some "help icon" that will be use to show "help text" with the help of the tooltip or pointers to admin section. Now I'm trying to understand how can I add in the posts/pages in ...
0
votes
1answer
39 views

Use an array of page template slugs and $hook

I'm using the function below to load some javascript that removes the checkbox in the User Profile that is used to toggle the Visual Editor: //Remove Visual Editor option in User Profile function ...
0
votes
1answer
40 views

How to add a class to Buddypress avatars in the Activity stream? [closed]

I'm in the process of trying to integrate bootstrap with Buddypress and am trying to add a class of "media-object" to Buddypress avatars. I could do this by mimicking the Bootstrap CSS, but in the ...
1
vote
1answer
25 views

Filter Posts from the Main Query

I want to conditionally merge a custom post type with my posts post type, based on a custom field. If the field's value is 1, then I want I need those custom posts to appear in the same loop as posts ...