Method by which plugins and themes extend core WordPress functionality.

learn more… | top users | synonyms

2
votes
1answer
138 views

How to save the values of checkbox to the register setting?

<?php function default_menu() { <form action="options.php" method="post"> <?php settings_fields( 'sample_check' );?> <input type="checkbox" name="sample" value="nofollow"/> ...
2
votes
1answer
233 views

publish_post plugin hook doesn't always pass $post->post_content

I've written a simple plugin that grabs the contents of a post, as the post is published, and sends them to an external site for archiving. This generally works but when dealing with posts that ...
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 ...
1
vote
1answer
86 views

Filtering the post list in the admin area

How can I filter my custom post type like it's filtered by WordPress itself? By that I mean the links that allow you to show only published, private or trashed posts. I need it because I want to ...
1
vote
1answer
84 views

How can I find the hook I need to rewrite a function?

I want to change the behavior of a bbpress/Buddypress "create group" page. I found the function I need to rewrite, it's the function create_screen in ...
1
vote
1answer
127 views

Lock user information once fields have been filled in

Much like the username is locked down and cannot be changed once it has been registered, I would like to lock down additional fields I have created with Advanced Custom Fields like the person's ...
1
vote
1answer
119 views

Add Lightbox To WordPress Native Gallery

Is there a way to check if a gallery is linked to an attachment page or to an image file via jQuery or WP filter? I'm trying to add a lightbox to gallery image that is linked to image file. But I ...
1
vote
1answer
544 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. ...
1
vote
1answer
191 views

How can I replace an oEmbed URL in post with actual embed HTML

What I want is to get the output of the Twitter oEmbed system into my actual posts. IMHO the embed output itself is high-quality, semantic HTML and I'd rather have it inside the post than in the embed ...
1
vote
1answer
830 views

How can I hook into creating a new post and execute wp_die(), before the post is inserted into the database?

Info about wp_die from codex: Kill WordPress execution and display HTML message with error message. A call to this function complements the die() PHP function. The difference is that HTML will be ...
0
votes
0answers
43 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
81 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
18 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
36 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
25 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
21 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
49 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
72 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
37 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
122 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
103 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
73 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
57 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
112 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
57 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
56 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
63 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
73 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
36 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
48 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; ...
0
votes
0answers
38 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
0answers
106 views

Redirect to custom post type admin page after wp_trash_post

I currently have a custom post type (enquiries) with a custom metabox which displays the date(s) for that enquiry, these are saved as metakey key value pairs, there can be one or more. the metabox ...
0
votes
0answers
36 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
0answers
83 views

Problem importing posts (get_categories is empty)

I want to import posts through an RSS plugin and events through a calendar plugin, and then have these plugins set the category for these imported posts. Then, using a hook (see code below), I want to ...
0
votes
0answers
143 views

Hook custom post type (ai1ec_event) to update transposh language

I'm using All-in-One Event Calendar and Transposh on a website that is designed to import content from websites all over the world, and automatically translate them. Right now any event that is ...
0
votes
0answers
74 views

Remove “enqueued” script from array

Im working on optimizing a child theme for a site and the parent "has more than we need" Lots of requests being generated all adds up to performance hits. What I'm trying to accomplish is this effect ...
0
votes
0answers
133 views

How to hook something before edit_form_title?

It's amazing to use the edit_form_after_title hook to enqueue something just below the post editor's title field. But there is nothing opposite to this like: edit_form_before_title. Searching over the ...
0
votes
0answers
74 views

Making Site A Use Site B's wp-content Folder

I'm trying to synchronize two WordPress sites and on my way I've faced few challenges. One of the challenges is to either synchronize the wp-content folder of two sites or make one site use the ...
0
votes
0answers
88 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 ...
0
votes
0answers
29 views

Trouble adding data to options table

I am trying to create a function that adds an option containing a subscription list to the options table. (This list is eventually referenced by a plug-in.) I am having some problems as there are two ...
0
votes
0answers
22 views

How to return a different page than the one requested

Description of the problem I am now developing a plugin whose purpose is to change the contents of the page a user requested depending on different variables (like, for example, user's location). By ...
0
votes
0answers
48 views

How to handle change the appearance of 'categories' box on dashboard?

I have a site with hundreds of categories, and when I come to edit some menu on wp-admin/nav-menus.php it is really difficult, because in the categories box there a few pages, with something like 20 ...
0
votes
0answers
80 views

Conditionally enable autoplay when using oEmbed in a custom widget

I'd like to have all oEmbed urls (youtube, vimeo, soundcloud, etc.) behave as they usually behave, with one exception. In my theme I've created a widget that gets data from a given post. The post ...
0
votes
0answers
2k views

Displaying list of cities according to the selected state. Using the WordPress hook

I come to ask the community a help of a simple hook on WordPress. I'm trying to display a list of states and cities in two dropdows to select a single option in the a form. The list of cities will be ...
0
votes
0answers
295 views

Get User Login Data (date, time… )

I did my best looking for information about this subject. Your guidance is appreciated. My goal is to perform some actions based on the number of user logins on my website per month and login days ...
0
votes
0answers
74 views

personal_options hook on Wordpress multisite

I have a working script that hooks to user profile. This is my hook: add_action('personal_options', array(&$this,'show_bounce_email_warning_to_user'),10,1); As you can see it will show bounce ...
0
votes
0answers
156 views

Can't update an option when the publish_post action is fired.

I'm using Tom McFarlin's Plugin Boilerplate, and I'm facing this huge problem where I can't update an option when the publish_post action is fired. I have a function that hooks into the publish post ...
0
votes
0answers
57 views

getting a post id from a custom type post

changed a wordpress to use custom type posts instead of pages. I'm Trying to update a plugin to work with this change. currently I'm stuck with just getting the right id from the post here's the ...
-1
votes
0answers
20 views

not able to hook the event for the state of article change to publish for the iOS app push notifications

i have developed an iOS app with wordpress as backend and i have written the server side code for the same. Now, i need to run my code when ever a post is published. Also i need to create a table to ...