Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

1
vote
0answers
95 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 ...
1
vote
0answers
69 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: ...
1
vote
0answers
57 views

I have 2 plugins using the same wp_login action hook and one is not working

so this is after a few hours investigating, I have s2member plugin and a custom plugin what happens is they are both using wp_login hook in this manner, s2member: add_action("wp_login", ...
1
vote
0answers
54 views

Add custom text in the media library image meta area

I want to add some custom text in this area in the media library: Is there a filter I could hook into or how can I add content there? If not, how do we do this using Javascript? I want the text to ...
1
vote
0answers
55 views

Issue understanding and using WordPress filters and actions

I have a custom WordPress plugin that I have developed. The plugin is a widget bundle containing a bunch of custom widgets. The scenerio The plugin allows for custom css styles through creating a ...
1
vote
0answers
85 views

Show message in media-new.php

I'm wondering if there's a way to show a specific message when user uploads a file using the wp-admin/media-new.php script. So far I have this: function my_uploads_notice(){ global $pagenow; ...
1
vote
0answers
37 views

Hooks are not being removed in child theme

I have a hook file: function load_admin_package(){ do_action('load_admin_package'); } /* * ----------------------------------- * Define hooks bellow * ----------------------------------- */ ...
1
vote
0answers
31 views

How to hook into unregistering a widget instance?

I would like to hook into a widget instance after it is removed from a sidebar panel on the Appearances -> Widgets admin page. So if the instance was an active widget and then removed, I would like ...
1
vote
0answers
93 views

Firing a function AFTER redirect

I am using a function that redirects the user to a custom page, rather than wp-login in the event of errors. In my case I am using the Http Referer function to send the user back to the same page ...
1
vote
0answers
80 views

Copy post to separate database with “add_action(…)”

I'm basically trying to have a copy of a post be sent to another database's table when it's published. I've gotten it to add a new row in the new table, with my own static arguments, but I'm not sure ...
1
vote
0answers
131 views

Hook into existing tinyMCE button

Is there a way to hook into an existing tinyMCE editor button? I have a plugin that currently has a button on the editor and it shows a popup-box when clicked. This box has tabs inside. I would like ...
1
vote
0answers
62 views

Add a new confirmation page before saving

I'm going to add a hook that does some modifications of the text before saving. Before making the changes permanent, I would like the user to confirm the changes after a "save_post" hook. Is there a ...
1
vote
0answers
113 views

Featured image upload finished hook

I'm looking for a way to hook into the process of uploading a featured image. Ideally I would want to be able to do some stuff right when the upload has finished, before the thumbnails are generated. ...
1
vote
0answers
80 views

Can I hook into wp_update_core outside of the admin?

I'm trying to bring some of the admin functionality to a custom front end in WordPress. Questions of security and pragmatism of this aside, is there an available hook to trigger wp_update_core outside ...
0
votes
0answers
29 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
16 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?
0
votes
0answers
9 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, ...
0
votes
0answers
15 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
35 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
0answers
17 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() { ...
0
votes
0answers
27 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 ...
0
votes
0answers
17 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
13 views

check_admin_referer always false when I use on add_action('load-'* hook

I have try to add hook on load my plugin page. But every time i save my config, it always return "Are you sure want to ..." message. Is there something i missed? Here's my code: <?php class ...
0
votes
0answers
29 views

Using 'add_attachment' to add taxonomy term on upload completion?

function amend_gametitle_upload( $game_title ) { global $post; if ( isset( $_REQUEST['post_id'] ) ) { $post_id = absint( $_REQUEST['post_id'] ); $post_obj = get_post( ...
0
votes
0answers
32 views

Checking if some condition is matched before inserting post into database

Is there a way to check if some requirements are matched before adding new instance of custom post type to database? Like custom policies for adding new posts etc? What I want to do is to build two ...
0
votes
0answers
15 views

Ask for template when adding a new page

I would ask the admin which template they would like to user when they click on "Add New" Page. Is this possible? I think I have seen something similar before where it ask you how many columns you ...
0
votes
0answers
28 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
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
0answers
55 views

Get the menu name or location of current menu item

I am having a hard time trying to get the name of the active menu and, apparently, I cannot find any solutions to this issue. Basically, I have several menus that follow this pattern: Menu Name ...
0
votes
0answers
12 views

Edit default action for profile_personal_options

Is there a way to edit the pre-existing action attached to the profile_personal_options hook that is built-in to WordPress?
0
votes
0answers
21 views

How to hook new args into a Custom Menu Widget?

I am trying to add some code before the list items in a sidebar Custom Menu Widget. Maybe I'll add an image, maybe I'll add some text. Not sure yet. But I'm having a hard time trying to figure it ...
0
votes
0answers
16 views

How to get WP to run plugin code triggered by an external site hook?

I have written a plugin to sync data from a WP blog to an external website. Changes to made to the external site also sync back to the WP blog. Right now the external website executes a POST request ...
0
votes
0answers
20 views

addaction hook cause redirection problem

I have added the hook in my wp functions: add_action('pa_taxname_edit_form_fields', 'woocom_edit_attribute_chk_field', 10, 2); function woocom_edit_attribute_chk_field($term, $taxonomy) { ...
0
votes
0answers
30 views

Customizing the built-in Media Playlist

I have a simple challenge I can't quite seem to make any progress on: Get the current track (or video) playing and display a link to a transcript of the song. This should be a simple task (and the ...
0
votes
0answers
28 views

PHP header() gives headers already sent

I am working on a checkout proces in Wordpress where if customer clicks on the checkout button he gets redirected to a payment provider. Important to know: I use a session in this proces. I use PHP ...
0
votes
0answers
55 views

Init hook for header send

I am working on a checkout proces where if I submit the checkout I get an error "headers already send" because I use a PHP header() function to send the customer to my payment provider url. My idea ...
0
votes
0answers
31 views

Which hook to use to add notification message at beginning of my <body>

i want to add dynamic messages to the beginning of my but I can't figure what hook to use. I have tried get_header but i can't append content to it... any idea? I don't want a solution that requires ...
0
votes
0answers
76 views

Wordpress upload file action hook

I have a custom post type called "Magazine" shown in the admin interface. Everytime a user uploads a file in the wp-admin to my custom post type "Magazine", I want to fire a hook because I have to ...
0
votes
0answers
82 views

Custom login errors and redirect

I am working on a custom login page in Wordpress and found these 2 functions for a redirect back to the custom login pages to show errors there and nog on the Wordpress default login page. The first ...
0
votes
0answers
17 views

Extra Editing Box in WP Dashboard

So I am trying to add an extra box in the WP post dashboard. In this box I will add a piece of HTML code. This code created the box in the WordPress area: $woo_metaboxes[] = array ( "name" => ...
0
votes
0answers
66 views

Plugin action hook fires when it should not (unrelated admin screen)

I maintain a plugin which generates a PDF of a page or post when an icon or link is clicked. PDFs may be cached, and as such, when a page or post is edited, we refresh the cache by regenerating the ...
0
votes
0answers
49 views

Hide post completely and still reach it via cURL

I've been struggling with this for several hours. I want to have a post hidden from every listing, including the posts edit screen, and having it not reachable by browsing to it. I successfully did ...
0
votes
0answers
96 views

Populate WYSIWYG field with ACF choice

So, I have a custom post type that uses a flexible content field containing a post object field and a wysiwyg field. The post object is to choose a post from a selected post type. After you choose ...
0
votes
0answers
87 views

Adding custom Bulk Actions

I have been looking around for ways to add custom Bulk Actions to the categories page. Most of them say that it is impossible to do it in a clean way, because of the lack of a hook for this. Most of ...
0
votes
0answers
43 views

Hook into trash_post_comments, update_user_meta

I have a theme where the author get points for posting posts and comments. When I trash a post, the user get 1 point removed from their score. This works fine with this function: However... When I ...
0
votes
0answers
38 views

Add class to all parent elements inside the_content

Is there a way to add a class to all parent elements inside the_content? My problem is I'm using this kind of css selector: .post_content>* {margin-bottom:10px;} This is to due with mostly ...
0
votes
0answers
51 views

WordPress Visual Editor Filter for Visual View

I have setup custom HTML to be created when a user inserts media using "Add Media" in WordPress using the code below: add_filter('get_image_tag', 'add_image_frames', 10, 6); function ...
0
votes
0answers
63 views

Displaying Single Future Posts in a specific Category or Taxonomy

I want posts that are tagged with a certain term and scheduled to be posted some time in the future to be publicly available. So if I create a post, assign it a special term (category, tag, custom ...
0
votes
0answers
28 views

admin insert media pop up hooks

I want to add the url to a specific image size in the add media (clicking the add media button in the post). At the moment I am adding the image to the post and getting the url and grabbing the url ...
0
votes
0answers
39 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; ...