52 results found for “posts”. Showing results 1 to 25.
-
If you are writing a plugin for WordPress, you will almost certainly find that you need to store some information in the WordPress database. There are two types of information you could store: This article describes how to have your plugin automatically create a MySQL/MariaDB table to store its data. Note that as an alternative…
-
If you haven’t noticed it yet, the WordPress Playground is an amazing feature that lets anyone safely run a temporary WordPress install within their browser. It uses WASM to run a complete WordPress install – PHP, database, and all – entirely from within your web browser. No server needed, nothing to install. For a while now Playground has…
-
This is a compilation of some of the most common issues the Plugin Review Team encounters when reviewing plugins. This list contains excerpts from the team’s email messages, and should not be considered a complete or exhaustive list; the outcome of the reviews depends on the manual review performed by the team. Security Sanitize Input…
-
Overview When writing endpoints it can be helpful to use a controller class to handle the functionality of an endpoint. Controller classes will provide a standard way to interact with the API and also a more maintainable way to interact with the API. WordPress’s current minimum PHP version is 5.2, if you are developing endpoints…
-
Overview Responses in the API are what holds all of the data we want. If we made a mistake in our request, our response’s data should also inform us that an error occurred. Responses in the WordPress REST API should return the data we requested or an error message. Responses in the API are handled…
-
WordPress 4.4 introduced the infrastructure for a REST API. The REST API provides an easy way to get data into and out of WordPress. Data can be retrieved and stored by sending HTTP requests to the REST API server. The REST API takes advantage of different HTTP methods. A resource is any single entity or object. A…
-
Overview The REST API is very simple in many ways. There is input, known as the request. The input is interpreted by the server and output is created. The output, is known as the response. In some ways, you can think of a request to the WordPress REST API as a set of directions or…
-
While any plugin can have an unlimited number of committers and support reps, there is only one official owner of a plugin at any time. This is akin to how a post on WordPress can only have one official post author. For Plugins With Under 10,000 Users If you’re transferring your plugin to a new…
-
Overview The REST API provides a way to match URIs to various resources in our WordPress installation. By default, if you have pretty permalinks enabled, the WordPress REST API “lives” at /wp-json/. At our WordPress site https://ourawesomesite.com, we can access the REST API’s index by making a GET request to https://ourawesomesite.com/wp-json/. The index provides information…
-
Guide to submitting plugins to the Block Directory The goal of the Block Directory is to provide a safe place for WordPress users to find and install new blocks. User Expectations Developer Expectations Definitions For the purposes of the Block Directory, we distinguish between two types of plugins: These guidelines apply specifically to the first…
-
In WordPress 4.9.6, new tools were added to make compliance easier with laws like the European Union’s General Data Protection Regulation, or GDPR for short. Among the tools added is a Personal Data Export tool which supports exporting all the personal data for a given user in a ZIP file. In addition to the personal…
-
Are you writing a plugin that handles personal data – things like names, addresses, and other things that can be used to identify a person? You’ll want to take care with that data and protect the privacy of your users and visitors. What is Privacy? WordPress.org made several enhancements ahead of Europe’s General Data Protection…
-
In WordPress 4.9.6, new tools were added to make compliance easier with laws like the European Union’s General Data Protection Regulation, or GDPR for short. Among the tools added is a Personal Data Removal tool which supports erasing/anonymizing personal data for a given user. It does NOT delete registered user accounts – that is still…
-
Every person who pushes code for, or aids in support for, a plugin is required to have their OWN individual account. These accounts do not have to be personally identifying (that is, you can name them PluginNameSupport1 if you wanted), however all accounts must be used by a single human for your own protection. There…
-
If you find a plugin with a security issue, please do not post about it publicly anywhere. Even if there’s a report filed on one of the official security tracking sites, bringing more awareness to the security issue tends to increase people being hacked, and rarely speeds up the fixing. To report a plugin, please email…
-
People cease development on their plugins for a variety of reasons. Instead of letting those plugins stagnate, we encourage people to instead list them for adoption by another, more active, developer. In adopting a plugin, you are promising to be responsible for all future development, and to ensure the plugin (and you) comply with all…
-
Adding Metadata Adding metadata can be done quite easily with add_post_meta() . The function accepts a post_id, a meta_key, a meta_value, and a unique flag. The meta_key is how your plugin will reference the meta value elsewhere in your code. Something like mycrazymetakeyname would work, however a prefix related to your plugin or theme followed…
-
Here is a non exhaustive list of functions and template tags used to get and render Post Metadata: the_meta() – Template tag that automatically lists all Custom Fields of a post get_post_custom() and get_post_meta() – Retrieves one or all metadata of a post. get_post_custom_values() – Retrieves values for a custom post field.
-
WordPress stores the Post Types in the posts table allowing developers to register Custom Post Types along the ones that already exist. This chapter will show you how to register Custom Post Types, how to retrieve their content from the database, and how to render them to the public.
-
This page will explain some aspects of the plugin directory, and explain of the more obvious aspects which a lot of people miss. To make your entry in the plugin browser most useful, each plugin should have a readme file named readme.txt that adheres to the WordPress plugin readme file standard. This file controls the…
-
WordPress comes with five default post types: post, page, attachment, revision, and menu. While developing your plugin, you may need to create your own specific content type: for example, products for an e-commerce website, assignments for an e-learning website, or movies for a review website. Using Custom Post Types, you can register your own post…
-
Custom Post Type Templates You can create custom templates for your custom post types. In the same way posts and their archives can be displayed using single.php and archive.php, you can create the templates: single-{post_type}.php – for single posts of a custom post type archive-{post_type}.php – for the archive Where {post_type} is the post type…
-
This information is here for historical purposes. If you’re not interested in how terms worked prior to 2015, you can skip this section. Prior to WordPress 4.2 Terms in different taxonomies with the same slug shared a single term ID. For instance, a tag and a category with the slug “news” had the same term…
-
Here are all the example code snippets from the preceding discussion, assembled into two complete code pages: one for jQuery and the other for PHP. PHP This code resides on one of your plugin pages. jQuery This code is in the file js/myjquery.js below your plugin folder. And after storing the preference, the resulting post…
-
If your plugin allows users to submit data—be it on the Admin or the Public side—it should check for User Capabilities. User Roles and Capabilities The most important step in creating an efficient security layer is having a user permission system in place. WordPress provides this in the form of User Roles and Capabilities. Every…