Last active
November 10, 2018 19:24
-
-
Save satouriko/ec905d5378fbfbdd585ab63dfd39c609 to your computer and use it in GitHub Desktop.
Revisions
-
satouriko revised this gist
Nov 10, 2018 . 1 changed file with 22 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,31 @@ <?php /* Plugin Name: Activate REST API Plugin URI: https://wordpress.org/plugins/enable-anonymous-rest-comment/ Description: Enable comments via rest api without login. Give front-end raw HTML via REST API. Version: 0.2 Author: Cooler Author URI: https://gist.github.com/rikakomoe/ec905d5378fbfbdd585ab63dfd39c609 License: Unlicense License URI: https://unlicense.org/ */ add_filter( 'rest_allow_anonymous_comments', '__return_true' ); add_action( 'rest_api_init', function () { register_rest_field( 'page', 'content', array( 'get_callback' => 'compasshb_do_shortcodes', 'update_callback' => null, 'schema' => null, ) ); }); function compasshb_do_shortcodes( $object, $field_name, $request ) { WPBMap::addAllMappedShortcodes(); // This does all the work global $post; $post = get_post ($object['id']); $output['rendered'] = apply_filters( 'the_content', $post->post_content ); return $output; } -
satouriko revised this gist
Jun 17, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,11 @@ <?php /* Plugin Name: Enable Anonymous Rest Comment Plugin URI: https://wordpress.org/plugins/enable-anonymous-rest-comment/ Description: Enable comments via rest api without login. Version: 0.1 Author: Cooler Author URI: https://gist.github.com/rikakomoe/ec905d5378fbfbdd585ab63dfd39c609 License: Unlicense License URI: https://unlicense.org/ */ -
satouriko created this gist
Jun 17, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ <?php /* Plugin Name: Enable Anonymous Rest Comment Plugin URI: https://developer.wordpress.org/plugins/the-basics/ Description: Enable comments via rest api without login. Version: 0.1 Author: Cooler Author URI: https://developer.wordpress.org/ License: Unlicense License URI: https://unlicense.org/ */ add_filter( 'rest_allow_anonymous_comments', '__return_true' );