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.

learn more… | top users | synonyms (1)

0
votes
1answer
2k views

Widget update function not saving values

Hello WordPress Answers! I'm having trouble with the widget update function saving values correctly, but first let me explain the situation. I'm writing a simple news ticker widget plugin, which ...
0
votes
2answers
3k views

What is the proper way to get logged in user id in a plugin?

I need to get logged in user id inside my plugin. Is this the proper way? $root = dirname(dirname(dirname(dirname(__FILE__)))); if (file_exists($root.'/wp-load.php')) { ...
0
votes
1answer
192 views

An adiitional function fires on my AJAX submit

I am working on a small community style website for my family to use. Mainly it is a small version of a social network so my nieces and nephews can have fun with each other. I have set up "freinding" ...
5
votes
1answer
186 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. ...
1
vote
1answer
86 views

Execute a function using ajax

I have a function called function getSingleAmazonProduct($asin=''). It returns an amazon product. I have a form field to enter the $asin. <div id="asinform"> <form ...
-1
votes
3answers
2k views

Can I change header.php of current theme through a plugin function?

I need to add some html into the header.php but instead of directly changing the header.php of my theme or creating a child theme, how can I do it with just actions and/or hooks?
0
votes
3answers
2k views

How to Create a Directory in a Plugin Folder?

I am creating a plugin in WordPress Version 3.4.2. When the administrator submits a form, a new folder is created inside my plugin directory and a file saved in this new folder. But it gives me the ...
0
votes
1answer
51 views

Plugin: database creation

Can someone tell me what's wrong with this function? function xattachments_db_install() { global $wpdb; $xattachments_db_version = "1.0"; $table_name = $wpdb->prefix ."xattachments"; ...
0
votes
1answer
108 views

Making a Custom Post Type Publish Loop

I want to re-publish all previously published products of a custom post type. Let's say the post type is "events" This is what I was thinking something like this: $args = array( 'post_type' => ...
4
votes
1answer
95 views

Update exisiting site to 3.5 release candidate

I have an existing site that I want to update to 3.5 now, because I want to see if my plugins and themes work in it. I don't want to wait for the full release (when I'll be able to automatically ...
0
votes
1answer
44 views

Plugin options page - save two related options as one entry

I created an options page for my plugin where the user can specify image dimensions which will be saved for later use. So far the image dimensions are entered by the user in one input field like ...
1
vote
5answers
3k views

WP_Query returns no results

I'm using wp_query to create a custom query that retrieves search results but it is returning 0 results. Here is the code: $query = 's=the&posts_per_page=5&paged=1'; $custom_query = new ...
0
votes
1answer
508 views

Admin Subpages without Menu entry

I have added some pages to the WP-Adminmenu, with add_menu_page and add_submenu_page. The URLs for those pages look like admin.php?page=my-plugin/admin/submenupage.php. If I try to add a page now that ...
1
vote
0answers
68 views

Possible to get all posts with my shortcode?

So here's what I'm trying to do. I'm building a plugin for a business directory. Each business is assigned to a category. There are two views, listing and detail. To give the user as much ...
0
votes
1answer
611 views

More gentle way to hook Wordpress custom url

I have written a plugin named foo, and I want when user typed url /hello and it will display the string world There is an existing post which uses the following code if ($_SERVER["REQUEST_URI"] == ...
4
votes
3answers
9k views

How to call a plugin function from index.php [closed]

I have created a function in my plugin myplugin with the name foo, how to call it from the frontend? e.g. index.php?
0
votes
2answers
320 views

Rewriting Image URLs from dynamic to original

Here's the deal: My plugin automatically watermarks images from the WP gallery on the fly using the GD library wherever these images appear. So, I have a physical copy (in wp-uploads) of these ...
48
votes
6answers
10k views

Where to put my code: plugin or functions.php?

Is there an easy to understand scheme to decide what kind of code belongs to a plugin or the theme’s functions.php? There are many cases and many debates about that topic, mostly because there are ...
-1
votes
1answer
250 views

Is it possible to debug plugins with Xcode?

I am mac user and I want to write a Wordpress plugin. Does Xcode work for me or do I need a different and specific IDE for this?
0
votes
2answers
696 views

Make get_permalink() work outside the Loop using filters

I am developing a plugin which displays a wordpress post in a lightbox outside the loop. I noticed that some plugin which modify the contents of the post (like Facebook Like button plugin) use the ...
0
votes
1answer
7k views

Open a wordpress single post in a lightbox without the header and footer

I am developing a plugin which requires to open a single wordpress post inside of a lightbox. Here are a few details : Currently,I am using colorbox for lightbox. The lightbox is triggered to open ...
1
vote
2answers
444 views

How to Make a Category Always Selected?

I'm trying to write a function to make certain terms of default category always selected. When the user is writing a new post, the term checkbox should be checked and he shouldn't be able to unckeck ...
1
vote
1answer
2k views

OOP Plugin and Menu - Call to undefined function register_setting()

WordPress documentation seems spotty on object-oriented code. I'm setting up a few plugins and the first should register settings and a menu page. It's throwing "undefined" for the ...
-2
votes
1answer
161 views

How to create an upload page (front side)

I would like to have a methodology for creating a functionality. When the user is connected, he will can access to a new page. In this page he will have the possibility to submit some fields like : a ...
17
votes
2answers
38k views

How to add a shortcode button to the TinyMCE editor?

How to make any plugin icon in wordpress post? The code I want to insert in plugin code and will appear in post bar [wp-admin/post.php]. Like this image: Output: If I click the icon it ...
-1
votes
1answer
44 views

Site is setup statically - how to make it content managable?

This is probably quite a basic question, but I have my site setup statically in WordPress, all I am trying to figure out now is how to add a new section to the WordPress backend where all the content ...
2
votes
2answers
742 views

Multiple files in a plugin

I'm trying to write a plugin with multiple files. I'm sure I did it before without a problem, but now I have the problem in the subject. In the main plugin file I have included a file name - ...
1
vote
2answers
133 views

Failed to invoke other hook from the init hook

Related to this question (Use wp init hook to call other hooks?) but not the same. Sometimes, I found that the hook will failed to run when I place inside the init hook, e.g. Not Work: ...
19
votes
3answers
4k views

Where do I put the code snippets I found here or somewhere else on the web?

Many posts here or somewhere else contain code, but they do not say where to put it. Example: I have found this post: How do I turn off 301 redirecting posts (not canonical)? I'm a newbie with PHP. ...
8
votes
2answers
2k views

Get a path to a different plug-in

To get a the path to a plugin you can use plugin_dir_path(__FILE__) - but this obviously has to be called from within the plug-in. How can you reliably get the path to plugin B (pluginb/pluginb.php) ...
1
vote
2answers
602 views

how to not show plugin in admin area

I'm just getting started with wordpress development. I'm trying to create a simple plugin that show results from a db in a table. I can do this, but I'm having trouble with the plugin showing at the ...
0
votes
2answers
44 views

Getting posts by taxonomy

I want to get a set of posts from a CPT based on a taxonomy term being present. I thought I'd use WP's get_posts() function: $results = get_posts(array $options); This function works fine when I ...
0
votes
1answer
582 views

Email verification feature in wordpress social login plugin

I'm using wordpress social login plugin.. It uses HybridAuth library. Here is a demo of HybridAuth library. The wordpress plugin looks nice. But it generates a random email for most of the social ...
2
votes
3answers
133 views

Nuance in adding CPT and TAX to a submenu

I have a lot of CPT's and custom TAXs and decided to put them into a few submenus. That worked just fine. I'll explain how I did that in a moment but the problem is that when you choose a "new term" ...
1
vote
1answer
45 views

Where to store the name of a custom table?

I'm extending the $wpdb object with properties for my custom tables. function setup_wpdb() { global $wpdb; // Create properties for custom tables $wpdb->my_plugin_table1 = ...
1
vote
1answer
88 views

How can i change the texts of plugin (created by me) in wordpress admin?

i have a created a contact us plugin, i want to change that name of the plugin "contact us" in Hindi. I already created languages folder in my wordpress, and maintaining hi_IN.mo, hi_IN.po files.
0
votes
2answers
143 views

WordPress templating system for custom plugins

I'm creating a custom plugin which needs to display HTML with dynamically updated values. To illustrate, here's what I want to achieve: <h1><?php print $title; ?></h1> ...
0
votes
1answer
68 views

Create and style menu

I have been assigned with the task to create a menu that can be added or removed from wordpress admin. Right now the menu is hard coded into the templates. But I want to use default menu function ...
11
votes
2answers
6k views

How to add sub-menu to a menu generated by wp_nav_menu by using plugin

I have a menu generated by wp_nav_menu which look like <ul class="nav-menu" id="menu-top-nav"> <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-43" ...
0
votes
1answer
70 views

Lead form that submits to 2 external APIs

I need to add 2 registration forms to my wp website, each form should submit the information in it to 2 different APIs. I don't know even where to begin. Is there a plugin that can help me handle the ...
0
votes
3answers
2k views

Creating open content area and restricted content area

I'd like to create a site that has two separate areas of content. One for members with a payment system and another one for regular viewers that gives teasers so that they would want to read more and ...
3
votes
1answer
925 views

Error with Custom Admin Screen in iframe Thickbox

I have a plugin that adds a new admin screen in an iframe. I created a PHP file in my plugin, and I put a link with a class of Thickbox to that. Everything works just fine, but it produces a PHP error ...
1
vote
2answers
766 views

Subscribe to author?

Basically, I want to follow the author by other WordPress users. Whenever an author posts new post subscribed users need to get notification by email. If it's not already there, I can create a plugin ...
0
votes
3answers
122 views

How to pull user/author profile data in a plugin?

My site has a user profile page. For some reason I would like to pull user profile data in my plugin. I know I can pull logged in user profile data using get_currentuserinfo();. For example I would ...
0
votes
1answer
64 views

How do I duplicate a single post, with all its properties, and save it as a different post?

In a wordpress plugin, how can I duplicate/clone a single post? I would need to: 1) get a specific post 2) clear its ID property so that it's saved as a new post 3) save it. In the process, I would ...
2
votes
0answers
1k views

How to bind data-src attribute for the image in the post using jquery?

I'm trying to use foresight.js for responsive image in the wordpress blog. For that I have to add the data-src attribute in the place of src in the <img> tag. Or I have to get the url from the ...
2
votes
0answers
140 views

permalinks with get variables

I'm trying to create my own permalinks with wordpress rewrite API. I have been registering my get variables as it follows add_filter( 'query_vars','driver_vars' ); function driver_vars( $vars ) { ...
0
votes
1answer
1k views

Remove Meta-boxes (Yoast SEO plugin) [duplicate]

Possible Duplicate: WordPress SEO by Yoast: Hide Meta boxes in posts for non-admins I was wondering how to remove Meta-boxes from the post page. I would like that only administrators or ...
1
vote
1answer
1k views

Custom GET Parameters In Plugin's Admin Page

In my plugin's options page, I'd like to have custom GET parameters. WordPress already has a "?page=" GET parameter, so simply linking to something like "?myparameter=value" won't work. I though of ...
0
votes
1answer
53 views

Create pages for authors

I have a pretty good question here. I would like to create a hidden page on my wordpress blog for each user as they are registered. I already have most of the code of what needs to be put on the page ...