Skip to content

Instantly share code, notes, and snippets.

Avatar

Schema.Press schemapress

View GitHub Profile
@schemapress
schemapress / schema-plugin-add-social-profile.php
Created Oct 16, 2019
Schema Plugin: Add additional Social Profiles links to Knowledge Graph https://schema.press/downloads/schema/
View schema-plugin-add-social-profile.php
<?php //* do not include php tag
add_filter( 'schema_wp_knowledge_graph_json', 'add_social_to_schema_wp_knowledge_graph_json_567656765' );
/**
* Schema Premium Plugin: Add additional Social Profiles links to Knowledge Graph
*
* @since 1.0.0
*/
function add_social_to_schema_wp_knowledge_graph_json_567656765( $schema ) {
View schema-acf-field-post-type-select-choices.php
<?php //* do not include php tag
add_filter( 'schema_acf_field_post_type_select_choices', 'schema_acf_field_post_type_select_choices_add_product_45263542' );
/**
* Schema Premium Plugin: Add missing post type "product" to Locations post type select choices
*
* @since 1.0.0
*/
function schema_acf_field_post_type_select_choices_add_product_45263542( $post_types ) {
@schemapress
schemapress / schema-premium-add-type.php
Last active Jan 26, 2019
Example: add support for new schema.org type in Schema Premium plugin https://schema.press/introducing-schema-premium/
View schema-premium-add-type.php
<?php //* do not include php tag
/**
* @package Schema Premium - Class Schema New Type
* @category Core
* @author Hesham Zebida
* @version 1.0.0
*/
// Exit if accessed directly
View schema-author-url-remove.php
<?php //* do not include php tag
add_filter('schema_wp_author', 'remove_author_url_markup_588877256');
/**
* Schema Plugin: Remove Author URL since it has the username id exposed.
*
* @since 1.0
*/
function remove_author_url_markup_588877256( $author ) {
View schema-remove-datePublished.php
<?php //* do not include php tag
add_filter('schema_output', 'remove_datePublished_markup_588545256');
/**
* Schema Plugin: Remove datePublished markup on BlogPosting
*
* @since 1.0
*/
function remove_datePublished_markup_588545256( $schema ) {
View schema-author-output-modify.php
<?php //* do not include php tag
add_filter( 'schema_wp_author', 'schema_author_output_modify_8198771356' );
/**
* Modify The Author Schema Markup in Schema Plugin
*
* @param array $author
* @return array
*/
function schema_author_output_modify_8198771356( $author ) {
View schema-blog-output-remove.php
<?php //* do not include php tag
add_filter( 'schema_blog_output', 'schema_blog_output_remove_8987716235' );
/**
* Remove Schema Plugin markup for Blog on home page
*
* @param array $schema
* @return array
*/
function schema_blog_output_remove_8987716235( $schema ) {
View schema-truncating-headlines.php
<?php //* do not include php tag
add_filter('schema_wp_filter_headline', 'truncating_headlines_chars_567545256');
/**
* Schema Plugin: Truncating Headlines by characters count
*
* @since 1.0
*/
function truncating_headlines_chars_567545256( $headline ) {
View schema-truncating-headlines.php
<?php //* do not include php tag
add_filter('schema_wp_filter_headline', 'truncating_headlines_words_567545256');
/**
* Schema Plugin: Truncating Headlines by words count
*
* @since 1.0
*/
function truncating_headlines_words_567545256( $headline ) {
View schema-wp-output-category-enabled.php
<?php //* do not include php tag
// Disable CollectionPage schema output on Categories
add_filter( 'schema_wp_output_category_enabled', '__return_false' );
// Disable CollectionPage schema output on Tags
add_filter( 'schema_wp_output_tag_enabled', '__return_false' );
You can’t perform that action at this time.