Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

-1
votes
0answers
16 views

How to string lines from the_content() hook in WordPress?

Inside my content-video.php template, I have the following codes: <iframe src="<?php echo get_the_content(); ?>" width="960" height="540" frameborder="0" allowfullscreen="allowfullscreen">...
7
votes
2answers
4k views

How do I implement the WordPress Iris picker into my plugin on the front-end?

This question here is asking the same question as I am, but there were no adequate answers nor a selected correct answer so I am asking again hoping if I ask in a more coherent manner I might get a ...
3
votes
1answer
41 views

'post_type_link' filter not working

I know it should work fine, don't know if this is a recent bug or something. So, to confirm it, I installed a fresh wordpress using default theme. I made a small plugin like bellow: <?php /* ...
7
votes
4answers
246 views

Is it possible to completely stop WP_Query retrieving posts?

I'm trying to use WP Redis to cache entire $wp_query object with key is $query_vars_hash. This is how $wp_query was added to $wp_object_cache: add_action('wp', function($wp) { if ( is_admin() ) ...
1
vote
0answers
16 views

Edit page slug after save, cause 404 by linked pages

I have two page bar page at url: http://www.example.com/bar/ foo page at url: http://www.example.com/foo/ bar page link to foo page in content, eg.: <a href="http://www.example.com/foo/">...
1
vote
1answer
69 views

Best possible way to get all options

I need to provide a list of all options set via plugins etc to remote calls. There is a plugin WP API Options but it hardly does the job. There are two possible ways (that I know of) to get a list ...
0
votes
1answer
26 views

Move jQuery on *top* of footer

I am using this code by Peter Wilson to move jQuery to footer: function pwcc_jquery_to_footer( &$wp_scripts ) { if ( is_admin() ) { return; } /* Move jQuery to the ...
0
votes
2answers
546 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 '...
3
votes
1answer
67 views

Hook/notify when any option or setting is added or updated

I know about: add_option_{option_name} update_option_{option_name} but these need specific option names. What I am looking for is a way to know if and when any option is changed (added or updated). ...
0
votes
1answer
68 views

How to trigger function on theme delete?

Tried to find an or some hook to fire a function when theme is being delited, but didn't find any hook.. May be someone can tell if there's a way to fire my function on themes delete event? I need ...
2
votes
0answers
23 views

Remove and restore one shortcode

I would temporarily remove a shortcode, make something and restore it... it's possible? // override default wordpress "the_content" hook remove_filter('the_content', 'do_shortcode', 11); add_filter('...
2
votes
2answers
77 views

do_action and hook methods

I am trying to understand how hook methods work in WordPress. I understand that when do_action is called WP looks for all registered listeners and invokes them according to set priority. How does ...
3
votes
1answer
31 views

Generic plugin (de)activation hook?

I am looking for a way to track which user activates or deactivates a plugin for logging purposes. I've been searching around, but can only find information for plugin developers to have a hook to (de)...
0
votes
0answers
34 views

Cannot override price in cart using 'woocommerce_before_calculate_totals' hook

I have created a custom product type in woo-commerce. And extended the WC_Product class as below. class WC_Product_wfpb extends WC_Product{ var $wfpb_sprice; var $wfpb_onproduct; var $wfpb_oncart; ...
1
vote
3answers
103 views

new WP_Query() - what is the earliest valid hook?

Specifically, is it valid to run a new WP_Query() during the plugins_loaded action?
0
votes
0answers
18 views

Woocommerce Product Pages, Hooks, changing page layout

I'm trying to rearrange the layout of the product listing below. I'd like the short description to appear next to the product image, rather than below it. Now I know I need to change the hooks in the ...
-1
votes
1answer
34 views

Why functions metaboxes is causing White Screen in Admin [closed]

I am having an issue after migrating a project to other server. When I go to /wp-admin I am getting a 'White Screen of Death'. If I access to /wp-login.php instead I get the login form but with an ...
1
vote
1answer
26 views

How to use a hook to override an update_post_meta call in a plugin?

A plugin I'm using contains the following code: $download = array( 'post_title' => $title, 'post_content' => '', 'post_status' => 'publish', '...
0
votes
1answer
919 views

Add content after get_header

I'd like to add content directly after the div#main (end of header.php) and before /div#main (beginning of footer.php). I'm using an own child-template (of twentythirteen), that contains only style....
1
vote
1answer
24 views

Custom Front End Registration - How Does the Key work in the Password Set Request?

I've been working from some tutorials on building a front end registration / login system. Specifically this link - http://cubiq.org/front-end-user-registration-and-login-in-wordpress Everything is ...
2
votes
1answer
24 views

Is there a filter hook that I can use to change how taxonomy term names are displayed?

I need to hide a custom taxonomy's terms' names on the frontend while preserving them on the backend. Instead of the terms' names I need to display pseudonyms. I can't find a single filter hook to do ...
1
vote
2answers
596 views

How to use the 'comments_number' filter?

I'm not sure how to use this filter. Could someone show me an example? I'm trying to change ('0', '1', '%') to ('0 Comments', '1 Comment', '% Comments'). I'm using this function to get the comments ...
0
votes
1answer
16 views

Adding user filter - Not updating data in URL

What I am trying to do I am trying to add a filter option by adding a dropdown menu that i have hooked onto restrict_manage_users, so i can filter users by a specific meta value. My problem When i ...
-1
votes
0answers
15 views

Dump new user data into codeigniter user's table

Here is the flow: Add new user from WordPress dashboard. Grab the newly registered user's data. dump user's data into codeigniter app database What i have tried: using user_register action hook ...
3
votes
4answers
11k views

How can I edit post data before it is saved?

I have a plugin and I would like to be able to run the post content through some filters before it is saved to the database. From looking at the plugin api, I see that two hooks that look like they ...
0
votes
1answer
548 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) { console.log(...
3
votes
1answer
20 views

What function to hook for changes made in status and visibility of a post

I have a function to run every time a post is published or updated in anyway. Right now I am doing function myFunction(){ //Do Something } add_filter('publish_post','myFunction'); add_filter('...
0
votes
0answers
11 views

There is any hook that fires after/before updating menus locations in “Manage Locations” tab?

I'm looking for hook that fires before or after updating menus location. I want to fire function after saving on "Manage Locations" tab in Appearance > Menus. I know there is wp_update_nav_menu ...
4
votes
0answers
23 views

Admin settings update updating every time home page is hit?

I have created a plugin that sends an email with all orders placed that day by X o'clock to email Y. I followed the tutorial here: https://scotch.io/tutorials/how-to-build-a-wordpress-plugin-part-1 ...
0
votes
1answer
531 views

Create action running on trashed_post hook to modify post_meta value

I have a custom post type that always do math operation to its post_meta and other custom post type post_meta. For example: post-type 1 = cpt_product_order post-type 1 post_meta = ...
3
votes
5answers
2k 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 = get_user_by('id'...
0
votes
2answers
32 views

Admin page and admin menu. Permissions plugin

I was googlin really hard but couldn't find any answers. What i'm trying to do is write a simple permission admin page plugin. So far what i did a page with every role where i can check a certain ...
2
votes
1answer
758 views

save_post hook not triggered in WP v3.6.1

I developed a plugin having a custom metabox that is using the save_post hook to store data. The plugin is 18 months old and is used by thousands of customers, so I'm pretty sure everything is good. ...
0
votes
0answers
15 views

On update, set post status to 'draft'

In my website I have created a custom post type named "Activities". A certain user group is able to add/edit these posts. I'd like to set the post type to "draft" each time a user (not administrator) ...
0
votes
1answer
18 views

Hook to change Author Info

Is there a hook or filter that will allow me to change the author of a post when someone views the page? Thanks!
7
votes
5answers
7k views

Is there a way to set default custom fields when creating a post?

When I'm creating a new post, just after clicking "Add New", when the post editor shows, instead of having to use the dropdown and choose a custom field to use, I'd like to have some default custom ...
4
votes
0answers
24 views

Adding a drag and drop re-ordering from a custom post type default list

I have custom post type named 'slider_to_be_ordered' and has the following arguments enabled: 'supports' => array( 'title', 'page-attributes' ), 'hierarchical' => true, ...
1
vote
1answer
42 views

External Authentication, session_tokens not destroyed on logout

There are many questions and answers on external authentication and some code prior to WordPress 4.0 need some tweaking to get them to work. For example, adding a fourth parameter to the ...
1
vote
0answers
20 views

Wordpress form. Variables to display on other page? [closed]

I'm using Ninja Forms, and I'm working on a form where when the users presses "ok" then the page is supposed to go to another page which shows specific information and links for that user. Right now ...
1
vote
1answer
29 views

Understanding WP

Sorry if this is a newbie question. For designing a woocommerce catalog page i usually copy woocommerce template folder into theme folder and start editing that (overriding template). I see there are ...
0
votes
0answers
11 views

Best way to change the author's name on view only

I'm developing a plugin that allows users to sign in and make posts. However, I have a substantial number of users and don't want them to be added as users in WordPress's user database, so I have my ...
8
votes
2answers
159 views

What is “all” in isset($wp_filter['all])

I'm a newbie in WordPress. I'm trying to understand how it generates the XHTML pages. I guess it's the function of do_action( 'hook-name' ) , but I'm stuck with the understanding of the instruction ...
1
vote
0answers
17 views

WooCommerce Template Override or Hooks for update safe customization? [closed]

I'm about to create a custom online store using WooCommerce for a client and I wanted to know some people's opinion on whether overriding the WooCommerce template structure or adding html code through ...
0
votes
1answer
19 views

Modifying the wordpress login page and then referencing it with a shortcode problem

Both parts are working great separately. I have made the shortcode for the login form with: //register new shortcode add_action( 'init', 'my_add_shortcodes' ); function my_add_shortcodes() { ...
0
votes
1answer
57 views

How to change Woocommerce breadcrumbs content?

I want to customize the breadcrumbs directly from PHP. Some of the pages are generated dynamically and do not exist in the database, therefore i must automatically put them in the breadcrumbs with ...
5
votes
1answer
56 views

How to customize the WP admin default help contents

I will be needing to customize the WP admin default help contents to be tailored specifically to a client in navigating his custom dashboard What are the hooks and sample codes to use in ...
0
votes
1answer
22 views

How to append custom text to the output of 'categories widget'?

How do I customize the "categories widget" to append additional text on the sidebar display? from category 1 category 2 category 3 category 4 to category 1 folder category 2 folder category 3 ...
2
votes
1answer
28 views

How to exclude certain widget from showing up on home/front page? [duplicate]

Without using a plugin, how do I prevent/exclude the sidebar widget "recent posts" from showing up on the home/front page? I do want it to show on the sidebar of rest of other archive/post pages.
1
vote
0answers
33 views

Shipping Options in Fedex Plugin for WooCommerce [closed]

I am a longtime PHP developer but new to WooCommerce and plugin development. I have a need to limit the transit time for certain perishable items. Therefore, I cannot always offer Fedex ground, but if ...
1
vote
1answer
28 views

Insert term when page is published - avoid duplicates after edits

So i want to dynamically add terms to a custom taxonomy named after new pages when these are published. Problem I have is that when you edit the page titles, another term will be added to the taxonomy....