Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

1
vote
1answer
57 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
42 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
15 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
22 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
51 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
72 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
40 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
22 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
52 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
30 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 ...
2
votes
1answer
81 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
46 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
75 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
27 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
33 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
28 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
392 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
68 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', ...
1
vote
1answer
55 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
99 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
39 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
138 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
29 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
52 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
36 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
21 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
82 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
24 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
56 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
80 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
54 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
53 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
33 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 ...
0
votes
1answer
37 views

Plugin Hook: Get posts

I am building a WP plugin. It shows several featured post images with titles atop. It will have a spot on the admin bar to tell it what the featured posts are. What hook do I use to get the post's ...
0
votes
1answer
56 views

New User Save Filter

I'm using the new(ish) filter add_action( 'user_new_form', 'funcy', 9 ); to add custom fields to Create A New User page. I'm then using add_action( 'personal_options_update', 'save_user_meta' ); ...
0
votes
0answers
22 views

URL mod rewriting for my custom links

My Actual link :- http://nanhai.com/nanhai-overview/162/ I want it like :- http://nanhai.com/nanhai-overview/xyz/ My code add_action('init', 'add_actor_url'); function add_actor_url() { ...
1
vote
2answers
210 views

Wordpress auto login after registration not working

So I looked up a bunch of threads trying to figure out how to automatically log a user in after registration, and came up with this. function log_me_the_f_in( $user_id ) { $user = ...
0
votes
1answer
119 views

get_the_post_thumbnail not working inside wp_get_nav_menu_items hook

if ( ! is_admin() ) { add_filter( 'wp_get_nav_menu_items', 'display_last_posts_for_menu_item_ts', 10, 3 ); } function display_last_posts_for_menu_item_ts( $items, $menu, $args ) { $menu_order = ...
1
vote
1answer
47 views

Wordpress capabilities and restricted categories access

I've a Wordpress blog to share content with some people only. Users has to login to access this website. I created new roles and new capabilities on this blog. I've got some articles which belongs ...
0
votes
0answers
73 views

Hook before & after plugin / core update

I'm working on a maintenance plugin for my website and I want to enable it before plugin/core upgrade starts and disable it after plugin/upgrade ends. Any ideas ? Thanks! :) PS: all I know is I can ...
1
vote
0answers
754 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 ...
0
votes
1answer
24 views

Which method to use when deleting posts from the front-end

I am trying to enlist all my posts on the front-end along with delete and edit links (using the shortcode API). I am having difficulty with the delete links. To me the most obvious way to handle ...
1
vote
2answers
46 views

apply_filters/do_action tag characters limit

Does apply_filters/do_action $tag name have a characters limit? Can be any problems if the tag name is way too long? I ask this because I know that WP transients have a limit of 45 characters. FYI, ...
0
votes
1answer
62 views

Add_menu_page() error message -> “You do not have sufficient permissions to access this page”

I'm currently building a website for a friend and have assigned him the user role of editor. I don't want to give him an administrator role in case he breaks the layout. Anyway, I am using ...
0
votes
1answer
159 views

get_post_meta not working inside a function in functions.php but works outside

function notify_new_posts($post_id) { $keyval = get_post_meta( $post_id); $buyer_wdistance = get_post_meta( $post_id, 'cf_wdrive'); //$buyer_wdistance = $keyval['cf_wdrive'][0]; ...
0
votes
1answer
167 views

Replace admin header logo with an image

I want to replace the default WordPress admin bar logo to my custom logo which is a PNG file. I have tried a code it's not working. function custom_logo_admin_header() { echo ' <style ...
1
vote
1answer
28 views

How to modify how the_content outputs a link to an internal page

I like the default add link dialog in the wordpress editor. IT allows for easy linking to internal pages. I need to modify the output of those internal links. Right now its outputting: <a ...
0
votes
1answer
49 views

Retrieving post ID from current page

I am following the tutorial here. Wordpress Ajax is a bit complicated but this tutorial helped me out a bit. The only question I have is, when I view any page, I want to be able to get the current ...
0
votes
1answer
39 views

$wp_query when new WP_Query

I'm trying something but I have an issue with WP_Query. I've an Hook on the_post in order to add some variation on the query. add_filter('the_posts', 'query_variation'); function ...