WordPress Plugins allow easy modification, customization, and enhancement to a WordPress blog. Instead of changing the core programming of WordPress, you can add functionality with WordPress Plugins
0
votes
0answers
30 views
How to add demo content to theme from outside plugin
I am devloping a new Wordpress theme that requires the installation of an outside plugin, called Revolution Slider. I would like to create a set of demo slider images for the user upon theme ...
1
vote
0answers
48 views
Am I not understanding plugins?
So I am trying to make it so that you can load a class from a child theme, theme or plugin using the following:
class AisisCore_Loader_AutoLoader{
protected static $_instance;
protected ...
0
votes
0answers
25 views
attachment_fields_to_edit stopped working in plugin following 3.5 update
Following an upgrade to WP3.5 Elvin, a plugin that duplicates images (by duplicating metadata, not by actually copying the image) stopped working.
The plugin, BDN Duplicate Images, is just one file ...
3
votes
1answer
70 views
Uninstall script for a plugin in Multisite
I've just realized that the traditional uninstall.php file along a plugin is not working in Multisite.
if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
exit();
delete_option( 'plugin_option_name' );
...
0
votes
0answers
14 views
How to access menu items object from within plugin?
how to access menu items object from within plugin? When I try to use wp_get_nav_menu_items() I get : Fatal error: Call to a member function get_page_permastruct()
3
votes
1answer
109 views
Using preg_replace to clean widget output HTML
I am working on a wordpress site that uses a plugin / sidebar widget. The issue I am experiencing is that the widget generates HTML that is not valid, an example of this is below...
<p>
...
0
votes
1answer
38 views
Check spam in custom form - akismet
I have a plugin that has input form, I have decided to check submitted data with akismet. I do have API key, WP comments are filtered correctly...
here is, what I found: ...
0
votes
2answers
99 views
Headers already sent error with CSV export plugin
I have built a Wordpress plugin that allows the user to export all pages, with their levels and urls, to a csv file.
The problem I have is that I keep getting error messages when trying to export ...
1
vote
0answers
35 views
Adding (blog-specific) links to “My Sites” admin page
The My Sites admin page only has links to the sites’ dashboards and production pages which is of limited value. I am trying to figure out a way to add a more useful links to them like New Post, ...
1
vote
0answers
37 views
Wordpress Localization and Templating
I'm using Smarty Templates for the back-end and Handlebars for the front-end for the plugin that I'm building.
It's only now that I discovered that the localization doesn't work when I declare my ...
2
votes
0answers
62 views
Plugin development with unit tests
One of the things that my plugin does is creates a number of SQL tables as part of a versioning function (that is run under the admin_init hook as I couldn't find a better wordpress way of doing ...
6
votes
1answer
68 views
API to trigger prompt on leaving page
I have a proprietary plugin that creates a metabox on the edit-post page. When the data managed by the plugin is edited and the user navigates away then we would like the user to be prompted as ...
5
votes
1answer
73 views
Listen to Post action
I am writing a plugin that adds a custom metabox to the post page. I would like to trigger an event when the user navigates away from the edit post page or when a user stops editing a specific post. ...
0
votes
1answer
34 views
Dynamically generate meta tags and titles for a wordpress page
I have created a wordpress page that will output product details of a specific product from amazon: wordpress/product?asin=123
I'm just using the product page as a template and it really contains ...
1
vote
2answers
43 views
How can I prevent my plugin's next version from updating one of the files?
I read in another question that all the files in the directory are deleted during an update and this is bad design. Got it. Prevent plugin from deleting important directories
Is it possible to not ...
0
votes
0answers
24 views
Want to catch only the value between quote in metavalue SQL
HI I'm working on wordpress and I want to make a SQL request to catch only the value between "" stored in my bdd from usermeta.
For example :
a:2:{i:0;s:2:"82";i:1;s:2:"78";}
i want to catch 82 ...
0
votes
0answers
27 views
wp_schedule_event attempt causes T_CONSTANT_ENCAPSED_STRING error
I'm developing a plugin and am trying to set up a recurring event for it. However, even putting the function that I'm about to link to an activation hook in my file causes wordpress to throw this ...
2
votes
2answers
2k views
Custom height/width for thickbox in WP Backend
I use thickbox in the WP backend for preview or other content. On own pages in the backend works my script very fine and a can use custom width and height for the thickbox. below my code:
...
2
votes
2answers
52 views
When would I use either function for plugins?
I am curious as there are three function for loading files in plugins:
plugin_dir_path() and plugins_url(), along with plugin_dir_url() So as a plugin developer, which would you use for loading php ...
0
votes
1answer
37 views
Fatal error: Cannot redeclare admin_notice() [closed]
I'm writing a plugin, most of my code is wrapped in classes, except for an admin_notice fallback function that I call when I am not loading the main plugin class:
class MyClass {
//Main plugin ...
2
votes
3answers
2k views
Change default admin page for specific role(s)
I was wondering if anyone knew of a plugin or a way programmatically to change the the default admin page for a specific user/role?
I have a master panel page for my plugin currently setup with ...
0
votes
0answers
46 views
rewrite rule, add query var, but it is not in the function.php, it is in the plugin
I tried to create a plugin so that users don't need to edit other files (like function.php, header.php).
I tried to add a rewrite rule in the plugin, all things works fine, but add query var.
My code ...
0
votes
0answers
36 views
method doesn't work when being called from wp cron
I don't know what's wrong but the method that I'm trying to execute doesn't seem to be running when being called through wp cron. In the code below I'm trying to insert a new blog post. When I have ...
2
votes
1answer
34 views
Plugin: How should I handle deleting comments?
I am writing a plugin that creates an api for a custom post type.
Users can comments on the custom post types and the comments are added using WP core comment methods.
My question arises when trying ...
1
vote
2answers
47 views
How to check if current static page is frontpage from admin plugin
I set static page as front page.
I need to know if user currently on homepage in my custom plugin.
Functions is_home() and is_front_page() doesn't works, since homepage is static page.
I can get an ...
4
votes
1answer
122 views
Nav Menu meta failing to import
I'm the author of the Nav Menu Roles plugin that lets you display/hide menu items based on the user's role. It has come to my attention that the menu item meta does not import when using the regular ...
0
votes
2answers
33 views
Add Page With Parent ID
I am writing a plugin that upon activation creates a set of pages. The first page that I create I want to be the parent of the rest of the pages that are added. For some reason, this is not working. ...
12
votes
4answers
232 views
Automatically determine minimum WordPress version required for a plugin?
When developing a plugin, is there a way to automatically determine the minimum version of WordPress that's required to run it? I want to make sure that the Requires header is accurate, but manually ...
1
vote
1answer
876 views
Update Option Stored in Multi-Dimensional Array
I have data in the wp_options table currently stored as a multi-dimensional array (profile_element_order):
...
0
votes
1answer
44 views
How can I change my assigned user role in WordPress 3.5.1?
My current user role is "Administrator". I'd like to change my role to "Editor" (through out database field).
I read Database_Description, but it did not help.
5
votes
2answers
111 views
What is wrong with using add_option with Multisite instead of add_blog_option in a plugin
I'm working on a new plugin but it's my first to save which will save an option to the database.
Currently I'm using add_option and I assumed that
- activation would fail or
- the wrong value would ...
1
vote
2answers
37 views
How to change the name of the “edit my profile” link in the WordPress admin backend
I am really confused at this point. I can not figure it out how to rename Edit My Profile link in the admin backend.
How can that be done?
3
votes
1answer
114 views
Redirect after deleting post and keep track of pagination
I have a custom post list in the admin panel. This list is paginated, so this is it's url :
wp-admin/edit.php?post_type=xxx, if I open the default page
wp-admin/edit.php?post_type=xxx&paged=n, ...
3
votes
4answers
657 views
Using a Theme inside a Plugin directory
I am building a mobile friendly plugin and put the theme directory inside the plugin directory.
If it's a mobile browser, how can I redirect to the theme in the plugin directory?
...
4
votes
3answers
843 views
How should one implement add_settings_error on custom menu pages?
The Professional WordPress Plugin Development book explains in detail how to properly use the Settings API, and it also demonstrates how to add Menus and Submenus, but unfortunately it doesn't provide ...
3
votes
1answer
62 views
Finding WordPress sites using my plugins
I've now developed two WordPress plugins and would like to see some sites that use it. I'm looking for a way to find sites that use a WordPress plugin I built.
However, the official guidelines, don't ...
1
vote
0answers
38 views
get_template_part from plugin
This is default get_template_part function inside WordPress:
function get_template_part( $slug, $name = null ) {
do_action( "get_template_part_{$slug}", $slug, $name );
$templates = array();
...
0
votes
0answers
58 views
How to add custom button to new media upload interface
I am developing a plugin and i want to add my own button to the wordpress media upload interface (WP version 3.5). Right next to the standard 'insert into page' button, i want my button to be there, ...
0
votes
1answer
24 views
How to load plugin static data from cloudfront
I am moving my site's static content data to Amazon S3+ CloudFront and i am successful in doing this for most part of my site (no plugin used) except for the plugin section.
For the plugin i am ...
0
votes
2answers
50 views
How to embed a new string in url?
I am creating a custom tours and travel theme in which I have created custom post type Cities, Locations, Destinations and i am using custom permalink structure. /%category%/%postname%/
So now I want ...
0
votes
0answers
25 views
uninstall.php file in Plugin to clean DB
I am aware that WordPress provides Plugins a nice way to clean up the db if the Plugin is deleted by providing the uninstall.php hook. You just have to place the cleaning code and it works.
But my ...
0
votes
1answer
25 views
Wordpress is giving a permissions error on plugin submission [closed]
I'm creating a new plugin (based on a previous plugin I created that works). The options pages show up fine but when I submit I get the "You do not have sufficient permissions to access this page." ...
0
votes
0answers
36 views
Plugin works when all in one file, but I get a strange text overlap output when splitting into two files
I am working on a plugin for myself that will export data from a custom table. The following code snippet creates a menu under "Tools" and lets the user select which fields to export (haven't ...
2
votes
1answer
150 views
Problem with sorting entries in a plugin's admin interface table
I'm developing a WordPress plugin that will display a publicly accessible noticeboard on a page.
I've been asked to add the means to delete existing posts from the noticeboard using the WordPress ...
3
votes
2answers
795 views
How to validate custom fields in custom post type?
I wrote a plugin that creates a custom post type with custom fields. To prevent users from entering incorrect information, how can I validate the data?
I assumed that the save_post hook function ...
-1
votes
1answer
200 views
How to exclude the particular category from the woocommerce plugin?
add_action( 'pre_get_posts', 'custom_pre_get_posts_query' );
function custom_pre_get_posts_query( $q ) {
if ( ! $q->is_main_query() ) return;
if ( ! $q->is_post_type_archive() ) return;
if ( ! ...
0
votes
1answer
63 views
wp-load.php redeclares classes
I am trying to load WordPress options within a standalone PHP file. The file is located in /wp-content/plugins/plugin-name/file.php. I have used the following to open wp-load.php:
if ...
1
vote
0answers
39 views
Unable to delete custom post types, confusion around capabilities
So I'm working on a plugin for creating a questions/answers system that's as simple and well-integrated as possible (not unlike this site) but am stuck at the creation of the custom post types.
You ...
2
votes
1answer
65 views
Add Admin Menu Inside Construct or Init
I thought I was making headway in my WordPress Development education until I ran across the Boilerplate for WordPress plugins and it uses a class object. I'm fine with that and understand those ...
3
votes
1answer
571 views
How to make a WordPress plugin translation ready?
What is the best way create a plugin that is translation ready?
It doesn't have to be translated from the beginning but it has to be easily translatable so fellow developers from different cultures ...


