0
votes
1answer
26 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
23 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
1answer
20 views

Howto check version of another plugin and then add a submenu page to it

i'm writing a plugin which requires another plugin. So i have to check first if the other plugin exists in a correct version. If yes i want to add a submenu page to the plugin page but here my code ...
0
votes
0answers
15 views

Meta query not working with pre_get_posts

This works $q->set('meta_key', 'available-date_%_from'); $q->set('meta_value', '20140701'); This doesn't $q->set( 'meta_query', array( array( 'key' => 'available-date_%_from', ...
0
votes
0answers
25 views

get_plugins() doesn't work after plugins_loaded

Any idea why the following code function my_plugin_load() { get_plugins(); } add_action( 'plugins_loaded', 'my_plugin_load' ); Throws this error? Fatal error: Call to undefined function ...
0
votes
1answer
17 views

Hook on creating a menu entry?

I need to run some code after a new item has been inserted into a WordPress nav menu. Is there any hook on menu modification or something similar?
0
votes
1answer
34 views

How to get menu location in wp_update_nav_menu hook

I want to get the menu location in the wp_update_nav_menu (during menu save action) add_action('wp_update_nav_menu', function ($id, $data = NULL) { error_log( var_export($data, true) ); ...
0
votes
0answers
30 views

register_activation_hook not working with symbolic links

I'm writing my first own Wordpress plugin. It's working great so far, except that now I need to create a few DB tables upon plugin activation. So I put register_activation_hook( __FILE__, ...
0
votes
1answer
69 views

Display_rows() and column_cb() strange behaviour

I found a strange behavior of my functions. I thought to pass the id from display_rows() to column_cb(), but the problem is that the program passes only the first digit. Any hint? column_cb(): ...
1
vote
1answer
43 views

Plugin activation hook in an abstract class

I would like to create a common abstract class to use for every WordPress plugin that I develop. As a part of the class' initiation process, I would like to fire the activation hook which calls an ...
0
votes
2answers
108 views

Post curl function save twice using plugin hook function wordpress

when i save a data with my curl function using hook to save a data twice. public function __construct() { add_action('init', array(&$this, 'init')); ...
0
votes
1answer
59 views

Gravity Forms plugin: How to use “gform_editor_js” action hook?

I have a question regarding this action hook: http://www.gravityhelp.com/documentation/page/Gform_editor_js. I'm not sure where to put this action hook. Can I use this action hook in my child theme's ...
0
votes
2answers
152 views

How do I add some javascript validation to the admin interface form's onsubmit?

I have a plugin that adds meta boxes to the admin interface and I need to do some validation when the user presses the "update" button before the form is submitted. Is there a WordPress action or ...
0
votes
2answers
70 views

Transition Post status not working

I have a plugin which uses the transition_post_status hook, to fire a custom function on post update. But I don't know why its not working. Here is the code add_action('transition_post_status', ...
1
vote
2answers
97 views

Hook to generate a dynamic sitemap with “All in One SEO Pack” Plugin

Besides the urls of posts, pages and categories, I need my site's sitemap to include the urls of various pages that display data coming from an external source other than the WP database (Rails API). ...
4
votes
1answer
126 views

Changing the “Plugin Activated” Message Default

Whenever an administrator in WordPress activates a plugin, upon the reload of the plugin page, a notice will appear upon successful activation reporting "Plugin Activated". Is there a way to change ...
-2
votes
1answer
58 views

How to place plugin hook in a wordpress template

In many WordPress plugins, there are installation directions to add <?php do_action('plugin_name_hook'); ?> in your theme's templates. Where exactly do I need to place this code and what should ...
1
vote
3answers
124 views

What are the benefit in adding hook in the init() hook?

I see a lot of plugins using this approach to add a new hook, e.g. add_action('init', function() { add_action('SOME_LATER_HOOK', xxx); add_filter('SOME_LATER_FILTER', yyy); }); Why they don't ...
0
votes
1answer
49 views

change output location of plugin function using a custom hook

I'm running the YouTube Video Fetcher plugin and it fetches youtube videos and displays it on your website. However, instead of displaying the video after the post, I want to hook the code into a ...
0
votes
1answer
22 views

Can my hooked uninstall class function access a global var declared in main plugin file?

My current setup is as follows... In the main plugin file, these two hooks are set (not inside any class): register_activation_hook(__FILE__, array('DG_Setup', 'activation')); ...
0
votes
1answer
83 views

How can I add a Custom Button to Add or Edit post / page next to Add Media?

I'm trying to add a custom button nearby the Add media on the wordpress Add and Edit Post/Page. How can I do that? Thank you very much for your help!
1
vote
0answers
68 views

How can I register a hook for all Custom Post Types that are published?

I'm developing a plugin. I want that when every Custom Post Type is published, a hook is called (where I send an email notification to the administrator). I know I can use: ...
0
votes
1answer
54 views

password_reset hook is not working

I am developing a plugin where a MySQL user is created with username same as WP-username and password is entered by user using form . Now If the user resets its password in WordPress then the same ...
0
votes
1answer
179 views

The Hook registration_errors was not called

I can't validate the custom fields in my plugin. I want to skip some registration on WordPress. My code snippet is here: add_filter( 'registration_errors', 'reg_user_register', 10, 3); function ...
0
votes
0answers
38 views

Plugin constructor called multiple times

I have plugin with the following structure - class emailPlg { static $tableName; static $pluginDbVersion = 1.0; function __construct() { global $wpdb; ...
1
vote
1answer
85 views

Filter or action hook to insert content on admin pages before </body> tag

I am developing an administrator plugin and want to be able to write some HTML content just before the last body tag . This content will initially be hidden then displayed with javascript when a user ...
0
votes
0answers
34 views

How to re-run the main query based on meta data value?

When a user requests a custom post url like */books/best-book-eva, I want to (with a plugin) hook in before the page is displayed (and the main query run if possible) check that posts meta value ...
0
votes
2answers
60 views

What hook can I use to modify custom post data before it is displayed on the page?

I need to check if a certain value is true in the post_meta right after the wp fetches a custom post from database, If it's false I need to modify/add some data to the post and then display the ...
0
votes
2answers
24 views

How to change value of $menu_class in ep_nav_menu?

How can i change value of $menu_class parameter in wp_nav_menu() so that I can give a special css class to one of items in menu for example "Home"? here is some code but they didn't show me the ...
0
votes
0answers
32 views

How to change style a menu item in plugin?

I want to assign specific style to a specific item in navigate menu like "Home" but in plugin not in theme. I think I must write something like this in my plugin: function change_home(..){ if($item ...
0
votes
2answers
603 views

Reposition Woocommerce Message

I'm trying to reposition the messages in my Woocommerce theme. For example the successfully added to cart message. They appear to automatically be placed at the very top of where the woocommerce ...
3
votes
1answer
68 views

Disallow a user to post in certain categories

I am writing a plugin that will disallow user to post in certain categories. I am trying to display an error message to the user when he tries to post in the restricted category and also want WP ...
0
votes
1answer
474 views

Plugin custom Action Hook not working

I am trying to create one basic plugin where I want to create my own action hook. Here is the code for the same. <?php /* Plugin Name: Demo Plugin Version: 1.0 */ do_action('basic_action_demo'); ...
0
votes
1answer
600 views

woocommerce product attributes

Forgive me if someone has asked this before, but i am trying to get some attributes displayed next to displayed content of product. I see the hook woocommerce_before_single_product_summary that ...
2
votes
1answer
8k views

How to customize woocommerce related products?

I have the following lines of code in my website that will display the related products at the bottom of my single product page in WooCommerce... functions.php: // display upsells and related ...
0
votes
1answer
30 views

How to create and use Custom hooks

I am newbie in wordpress. I have just created contact us plugin for my own project. In my plugin I have used many functions you can take a look of my code. I want to make this plugin based on custom ...
0
votes
1answer
2k views

How to add a new product type on woocommerce product types? [closed]

I want to add a new custom "product type" to woocommerce plugin: Tried to duplicate one of currently exist product type files (woocommerce template structure) as a new file (file name and inside ...
0
votes
0answers
81 views

functions.php conditional output for a single plugin

hope I've asked this correctly. Bizarre situation. I have some non-breaking spaces in my titles for typography reasons. They are added automatically where required in place of normal spaces by the ...
1
vote
1answer
41 views

Inserting above the comment template

I want to insert content, just above the comment template.I have tried all the word-press filters and hooks but failed. I want to insert the content above the comment template, I mean above all ...
2
votes
2answers
2k views

Add subtitle to Woocommerce product title

I'm using WooCommerce on a site built with Pagelines Framework. I need to have a subtitle/customisable field appear under the product name anywhere it appears in the site. As it is, WooCommerce ...
1
vote
1answer
141 views

Determine plugin name from within plugin_action_links filter

Is there any way to determine what plugin the plugin_action_links filter is addressing when it processes the filter? I'm trying to add some actions for each plugin on the /wp-admin/plugins.php page. ...
0
votes
1answer
66 views

How to hook into action/filter call

I'm about to create a very simple logging plugin. Every time an action or filter is fired I need to log it to the file. The idea is that we will be able to see exactly which actions and filters are ...
0
votes
1answer
42 views

how to change automatic placing of social plugins below content?

I'm wondering if it possible to change the automatic place below the_content() function; this is becuase I`m displaying custom information fields, but activating the social plugins which have not it´s ...
0
votes
1answer
467 views

WooCommer Product Category Loop - How to change the display order of the rating and price?

I want to do a very very simple thing : To re-order the display of the rating and price information on a WooCommerce product category loop. Now in the product category page I got 5 products, all of ...
0
votes
1answer
292 views

Insert new user with form submit 'init' hook

I'm posting a form to insert a new user and hooking my function to 'init'. This code is in my mu-plugins folder. The user gets inserted fine, but the page is not loaded after wards. My form action ...
0
votes
1answer
87 views

Find out if request is for custom post type archive before query runs

I am writing a plugin that is modifying the RSS2 feed for a podcast that uses a custom post type. After the query runs (on action hook template_redirect; See this question for why), I'm checking to ...
0
votes
1answer
86 views

Quick press publish post hook

To execute a function during publishing post publish_post action hook is used. But what is quick press post publish hook?
0
votes
1answer
29 views

Prevent plug-in scripts on a specific template?

I have a plug-in which is interfering with my Google Map Embed in the template I'm using for my about page. Is there a way to prevent that plug-in from hooking in all of it's script files through ...
0
votes
1answer
427 views

using wp_footer hook in a plugin

I'm using the wp_footer hook into the plugin and it doesn't work, but when I copy the code to the "functions.php" file of the active theme it does work, what is the possible problem in this situation ...
0
votes
1answer
164 views

Flipping Book PHP Code? Any experience?

Hi there guys quick question, using FlippingBook and calling a gallery within a page or post is with something like this: [book id='1' /] but I want to call the gallery directly from my code, so is ...