The api tag has no wiki summary.
12
votes
7answers
7k views
How do you create a “virtual” page in WordPress
I'm trying to create a custom API endpoint in WordPress, and I need to redirect requests to a virtual page in the root of WordPress to an actual page that ships with my plug-in. So basically, all ...
11
votes
2answers
426 views
New WP_Customize API - how does it work under the hood?
I noticed that if you make changes trough the new "customize" feature, when you navigate on a different page within the iframe preview document, your changes still apply, even if they are unsaved.
It ...
10
votes
2answers
3k views
Access WordPress API Outside of WordPress (command-line PHP)
I have a PHP script that I need to run as a cron job. However this script needs access to the WP API (get_pages(), get_post_meta() and get_permalink() specifically). I've followed the instructions ...
10
votes
3answers
314 views
Wordpress API Menu/Submenu Order
I'm developing a child-theme using Wordpress 3.4.2 and the development version of the Options Framework by David Price. This is my first theme and I'm relatively new to this, so I've had a look into ...
8
votes
2answers
1k views
How to pass variable to add_settings_section() callback?
I am attempting to automate, as much as possible, the Settings API function calls for each setting in a Plugin. Looping through the options array, and outputting add_settings_section() and ...
8
votes
3answers
4k views
Programmatically add a Navigation menu and menu items
Through API functions, I want to define a new Navigation menu, select it in the current theme, and then insert a few Pages as menu items. This is to be done for instance on a theme activation.
...
8
votes
1answer
3k views
Difference Between Filter and Action Hooks?
I have been looking at the plugin API a bit more in depth recently and I was wondering what real differences there were between action and filter hooks. They both are events that receive data as a ...
8
votes
2answers
203 views
Which of my blog and personal data is being transfered when Wordpress automatically checks for updates?
I'm generally concerned about privacy and I've heard that with each contact to the Wordpress API for update checks and similar a lot of my blogs data is being transfered.
To get a better impression, ...
8
votes
1answer
249 views
Using the Rewrite API to Construct a RESTful URL
I'm trying to generate rewrite rules for a RESTful API. I just want to see if there is a better way to make this work than having to write out every possible rewrite combination.
Ok so I have 4 ...
7
votes
1answer
332 views
How to create an API for my plugin?
I have been developing plugins for WordPress. Most plugins I have developed with two three classes and not so huge like Buddypress, WooCommerce or etc.
I am planning to make two open source plugins ...
6
votes
1answer
1k views
Best way to programmatically remove a category/term from a post
I am working on a script to convert all posts in a given category to use a postmeta flag instead (testing of MySQL has shown me that on a site as large as mine this will lead to a meaningful decrease ...
5
votes
2answers
253 views
WordPress.org API - Get plugin authors favorite plugins
There have been some recent additions to the WordPress.org plugin repository. Most notably the changes to the plugin page and the author profile page which now shows an authors favorite plugins.
I ...
5
votes
2answers
1k views
How to store username and password to API in wordpress option DB?
I'm currently developing a plugin and the chances are that I will more than likely release it on the public plugin repository so others can use it.
The plugin will be using an API and to use this API ...
4
votes
1answer
85 views
External WordPress API
I'd like to manipulate a WordPress website from another program/website. IS there an API already written that provides access, and authentication, to do this?
Ideally, I'll be using a multi-site ...
4
votes
2answers
855 views
How to use WP_Error $data argument?
The Call
$error = new WP_Error( $code, $message, $data );
The Output
Say I added three messages (msg A, msg B, msg C) to the code my_code and with the last message I added "Data" as $data, which ...
3
votes
2answers
500 views
What WordPress API function lists active/inactive plugins?
After seeing thousands of useful API functions in the WordPress core, I'm surprised to discover today that there ain't a function that would list the active plug-ins. I don't know you but I'm quite ...
3
votes
3answers
805 views
Does Wordpress have a “Form API”
I do most of my development in Drupal, however I am working on a Wordpress site and I need to make a form. Which got me thinking, is there a Form API for wordpress like there is Drupal? Is there a way ...
3
votes
2answers
155 views
List Table API - Safe to use?
Just curious what developers think about extending the WP_List_Table class for use on plug-ins.
I am working on a plug-in that will show a list of users (ID, name, email) then pull data from another ...
3
votes
1answer
996 views
Create API for single sign-on with 3rd party site
My site needs to integrate with a 3rd party software, which will live on its own sub-domain, hosted by the software company. I need to provide the 3rd party developers with an endpoint that they can ...
3
votes
3answers
2k views
What is the best way to get directory path for wp-config.php?
I am developer of the plugin mapsmarker.com which also offers several APIs which can be accessed directly (eg www.mapsmarker.com/wp-content/plugins/leaflet-maps-marker/leaflet-geojson.php?marker=1)
...
3
votes
2answers
1k views
WP function/filter for modifying http headers?
Is there a dedicated WP function, action or filter to use when adding/modifying the HTTP headers?
For now I just hook a PHP header() call into the WP 'init' hook like this:
add_action('init', ...
2
votes
1answer
582 views
WordPress JSON output
Update: I've changed the code as following
$cats = get_categories();
$output = array('categories' => array());
function collect_posts(){
$args = array( 'numberposts=' => 9999, 'category' ...
2
votes
2answers
77 views
How to override a function call in functions.php?
In functions.php of a theme makes a call to show_admin_bar(false) which hides admin bar in front end:
if (!is_admin())
{
wp_deregister_style( 'bp-admin-bar' );
if ( function_exists( ...
2
votes
2answers
2k views
wp_enqueue_style built in styles
I'm writing (rewriting) my plugin to use
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-ui-dialog');
Which is great!
But to use the dialog I need to load a jquery style sheet with ...
2
votes
3answers
142 views
WP.org API: Accessing plugin downloads “Today” value?
I'm developing a plugin to display stats for downloads and various other information that developers might want to display on their sites about what they have developed.
I've found documentation on ...
2
votes
2answers
281 views
What is the official way to consume the Wordpress API? (api.wordpress.org)
Was wondering if anyone knows here if the API at api.wordpress.org is free to use without keys. I haven't really found any information about key registration.
I'd like to use it to make a few ...
2
votes
3answers
843 views
An Unexpected HTTP Error occurred during the API request
I just did a clean install of Wordpress. But I have a problem when I install or use the WordPress API. So send me a sign
An Unexpected HTTP Error occurred during the API request.
The strange ...
2
votes
2answers
458 views
Theme Options page with tabs
I have a theme that I'm developing from an HTML template I have. I'm also designing an options page along with a plethora of plugins built-into the theme itself. I've chosen a tabbed interface and I'm ...
2
votes
2answers
399 views
get post type plural
Currently I'm trying to get the post type labels plural. In detail:
$GLOBALS['wp_post_types'][ get_current_screen()->post_type ]->labels->name
This is how I'm trying to retrieve it - in ...
2
votes
1answer
1k views
[Plugin WPML] : How to create a translation of a post using the WPML API?
I'm trying to figure out how to create a translation for a post using the internal WPML API (inc/wpml-api.php)
I simply want to create a translation for post ID xx, set some content and publish it.
...
2
votes
1answer
113 views
wp_insert_comment error. puzzled by date value
I am trying to programmatically insert comments in a bulk operation as part of migration routine.
Comments are in a SQL server table.
I receive the date info from the SQL server table field and ...
2
votes
1answer
282 views
Authentication/API Questions
We are trying to use S2Member to manage our WP site and memberships for a Flash program that we are launching. We'd like to use S2Member to authenticate the user when they login and remain logged in.
...
2
votes
1answer
211 views
What is the best way to move a plugin´s subdirectory+files to wp-content/uploads-directory?
I am developer of the plugin Leaflet Maps Marker (http://www.mapsmarker.com - "Pin, organize & show your favorite places through OpenStreetMap, OGD Vienna or any custom WMTS-map")
and have one ...
2
votes
1answer
141 views
In the new Theme Customizer API, how to send a value from the front back to the admin panel?
I'm digging a bit into the new Theme Customizer API, in particular into the javascript one, and what I find is delighting.
I've managed to add my own custom parameters, and I also have the javascript ...
2
votes
0answers
382 views
Wordpress JSON API Extend to Create Users [closed]
I have the JSON API Plugin installed on my wordpress blog and it works like a charm. However there is one functionality that i really need.
A method called create_user which should take parameters ...
2
votes
3answers
758 views
How do I create a widget that only allows a single instance?
How do I create a widget that only allows a single instance of a widget to be added through the Wordpress interface?
The default behaviour of widgets allows multiple instances to be added.
I am ...
1
vote
3answers
4k views
How can you check if you are in a particular page in the WP Admin section? For example how can I check if I am in the Users > Your Profile page?
I'm building a plugin and I want to add bits of javascript in the admin head but only for certain admin pages. I don't mean pages as in a WordPress page that you create yourself but rather existing ...
1
vote
3answers
218 views
Does WordPress's HTTP API use any caching?
I'm working on a plugin to will retrieve data from a remote server and display it on the Dashboard. To do this, I'll be using the WordPress HTTP API but I'm not seeing any information on the HTTP API ...
1
vote
2answers
543 views
Creating external apps Wordpress / How they work
I was wondering how does external app works for wordpress.com or wordpress.org.
Directly connecting to the wordpress database seems a bad idea to me.
Questions
How can I create an app or get / ...
1
vote
2answers
978 views
How should I use register_setting, add_settings_section, & add_settings_field in my plugin's options page?
I'm working on a settings section for my plugin, and after reading over Wordpress's documentation which is in ROGUH DRAFT status, and also the Creating Options Pages - which is also in "transition", ...
1
vote
1answer
221 views
API integration with WordPress
I'm trying to integrate a 3rd party API with WordPress. I fear this is above my head. I was this code but I'm not exactly sure how to make is work in WordPress. Is it possible?
$ch = curl_init();
...
1
vote
1answer
180 views
How Can I Use $wpdb in PayPal IPN file?
I'm currently writing a plugin that requires the PayPal IPN, since the IPN is not inside the main plugin file, I have no way to use $wpdb. If you know a way to do this that will work with all ...
1
vote
3answers
397 views
Possible to use wordpress as publishing platform but programmatically inject content?
I have user generated content that is created in a mobile app that is written to a SQL Database.
I'd like to create a new site that allows this content to be viewed on a per user basis. So if I go ...
1
vote
2answers
272 views
Unable to find API Key for my blog
I have the blog http://kracekumar.wordpress.com, I need to find the API KEY of my blog,I clicked on Global Dashboard->My profile,it was mentioned in wordpress site that it will be found in top left ...
1
vote
1answer
118 views
How to add an alternative style sheet as a theme option?
I'm trying to create a few extra theme options in the "customise" section of the wp admin menu. I would like to offer an option to load an alternative style sheet.
Question: How can I adapt the ...
1
vote
1answer
77 views
Custom Post-to-Post with multiple parents?
I currently have a custom post type of "Faculty" - each faculty can have zero or many custom post type "Bibliographies," and a bibliography can belong to one or more faculty.
What is the best ...
1
vote
1answer
464 views
How can I add an options page for my class based plugin?
I'm trying to use the new Settings API with a class based plugin to add a settings page. This is the code I have so far:
class simple_sample_plugin{
function simple_sample_plugin()
{
...
1
vote
1answer
214 views
Sending WP posts to external API
What's the best method for sending all new Wordpress Posts to an external script on another server?
It needs to include the full post information including the post content, so a simple ping is not ...
1
vote
1answer
528 views
Integrate ZOHO Recruit API?
I'm working with a client using ZOHO Recruit to manage his staffing agency. The form for candidates to submit their information is given by ZOHO as a simple embed code. However, for employers to ...
1
vote
1answer
536 views
Custom routing for plugins
I am making a plugin that needs a page that can be accessed from the outside, pretty much like an API, and have the url like so,
http://xxxxx/custom_method?parameter=xxxxx&something=xxxx
is ...