This file contains 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 characters
<?php | |
/* | |
* @desc Add custom data to what is returned by the web services. All custom data will be available to the JS API. | |
* @param $post_data | |
* @param $post | |
* @param $component | |
*/ | |
function wpak_add_custom_data( $post_data, $post, $component ) { | |
$taxonomy = 'category'; // We search for categories |
This file contains 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 characters
<?php | |
/* | |
* Applies to: since WP-AppKit 0.1 | |
* Goal: By default, embeds are stripped from post content when send to WP-AppKit apps. | |
* We'd like to display embeds in apps (such as YouTube, Vimeo, SlideShare...). | |
* Usage: In the app's theme PHP folder or a separate plugin. | |
*/ | |
add_filter( 'wpak_post_content_format', 'wpak_post_content_with_embeds', 10, 2); | |
function wpak_post_content_with_embeds( $content, $post ) { |
This file contains 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 characters
<?php | |
/* | |
* Applies to: since WP-AppKit 0.1 | |
* Goal: By default, iframes are stripped from post content when send to WP-AppKit apps. | |
* It removes iframes inserted by WordPress through the oEmbed mechanism like videos (https://codex.wordpress.org/Embeds). | |
* We'd like to let iframes pass to the app to display video embeds in apps. | |
* Usage: in the app's theme PHP folder or a separate plugin. | |
*/ | |
add_filter( 'wpak_post_content_allowed_tags', 'wpak_allow_iframe_tag', 10, 2); | |
function wpak_allow_iframe_tag( $allowed_tags, $post ) { |