Comments (1)
Hi,
Here is an alternative way strait from the Wordpress Docs
And my current implementation:
/**
* Add REST API support to an already registered post type.
*/
add_action( 'init', 'my_custom_post_type_rest_support', 25 );
function my_custom_post_type_rest_support() {
global $wp_post_types;
$post_type_name = 'docs';
if( isset( $wp_post_types[ $post_type_name ] ) ) {
$wp_post_types[$post_type_name]->show_in_rest = true;
// Optionally customize the rest_base or controller class
//$wp_post_types[$post_type_name]->rest_base = $post_type_name;
//$wp_post_types[$post_type_name]->rest_controller_class = 'WP_REST_Posts_Controller';
}
}
You can make small plugin or just shove it to the functions.php of your current theme until it`s implemented to the plugin.
Have an awesome day :)
from wedocs-plugin.
Related Issues (20)
- weDocs' sweetalert library is conflicting with several plugins, including Dokan
- Change the default behavior of article print layout
- New Features ideas
- Suggestions For Improvement HOT 2
- Include tags in search
- Convert doc to pdf HOT 1
- Convert HTML single-page file into multiple pages with WeDoc structure HOT 1
- No borders in mobile view
- "Was This Article Helpful To You?" doesn't work or update
- WeDocs in Oxygen Builder HOT 4
- Private Docs
- Security vulnerabilities HOT 1
- Analytic Feature
- [FEATURE] Ctrl+K/Search box on documentation pages HOT 3
- [FEATURE] Add Gutenberg block support and relevant Gutenberg block settings instead of Shortcode
- [FEATURE] Make Assistant Widget Movable with Relevant Settings
- Plugin hangs in database update HOT 2
- Template override is not working HOT 1
- [BUG] Arrow dropdown should be visible on weDocs free version. HOT 1
- weDocs is not working properly with multisite network
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wedocs-plugin.