Plugin Directory

Changeset 2456178


Ignore:
Timestamp:
01/14/2021 09:57:17 AM (5 years ago)
Author:
fudugo
Message:

Updated readme.txt and metabox.php

Location:
fudugo-schema
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • fudugo-schema/tags/1.0.0/fs-schema.php

    r2455564 r2456178  
    66 * Tested up to: 5.6
    77 * Requires PHP: 5.6
    8  * Author: Fudugo Team
     8 * Author: Fudugo
    99 * Author URI: https://fudugo.com
    1010 * Text Domain: fs-schema-wordpress
  • fudugo-schema/tags/1.0.0/includes/class-fs-metabox.php

    r2455564 r2456178  
    322322            return $post_id;
    323323        }
    324         $post_type = esc_attr($_GET['post_type']);
     324        if(isset($_GET['post_type'])) {
     325            $post_type = $_GET['post_type'];
     326        }
    325327
    326328        // Check permissions
     
    335337        $schemaFields = $schemaModel->getSchemaFields();
    336338
    337         foreach ( $schemaFields as $schemaID => $schema ) {
    338             $schemaMetaId = "fssc_" . $schemaID;
    339             $data         = array();
    340             if ( ! empty( $schema['fields'] ) ) {
    341                 foreach ( $schema['fields'] as $fieldId => $fieldData ) {
    342                     $value            = ( ! empty( $_REQUEST[ $schemaMetaId ][ $fieldId ]) ? fssc_sanitizeInputValue($_REQUEST[ $schemaMetaId ][ $fieldId ],  $_REQUEST[ $schemaMetaId ][ $fieldId ]['type']) : null );
    343                     if(!is_array($value)){
    344                         $value        = $schemaModel->sanitize( $fieldData, $value );
    345                     }
    346                     $data[ $fieldId ] = $value;
     339        if( ! empty( $schemaFields )){
     340            foreach ( $schemaFields as $schemaID => $schema ) {
     341                $schemaMetaId = "fssc_" . $schemaID;
     342                $data         = array();
     343                if ( ! empty( $schema['fields'] ) ) {
     344                    foreach ( $schema['fields'] as $fieldId => $fieldData ) {
     345                        $value            = ( ! empty( $_REQUEST[ $schemaMetaId ][ $fieldId ]) ? fssc_sanitizeInputValue($_REQUEST[ $schemaMetaId ][ $fieldId ],  $_REQUEST[ $schemaMetaId ][ $fieldId ]['type']) : null );
     346                        if(!is_array($value)){
     347                            $value        = $schemaModel->sanitize( $fieldData, $value );
     348                        }
     349                        $data[ $fieldId ] = $value;
     350                    }
    347351                }
    348             }
    349             $meta[ $schemaMetaId ] = $data;
     352                $meta[ $schemaMetaId ] = $data;
     353            }
    350354        }
    351355        if ( count( $meta ) > 0 ) {
  • fudugo-schema/tags/1.0.0/readme.txt

    r2455564 r2456178  
    22Contributors:  fudugo, neha13
    33Tags: json-ld, structured data, schema, rich snippets, Microdata, SEO, local seo, google, sitelinks, schema.org.
    4 Author: Fudugo Team
     4Author: Fudugo
    55Author URI: https://fudugo.com
    66Version: 1.0.0
  • fudugo-schema/trunk/fs-schema.php

    r2455564 r2456178  
    66 * Tested up to: 5.6
    77 * Requires PHP: 5.6
    8  * Author: Fudugo Team
     8 * Author: Fudugo
    99 * Author URI: https://fudugo.com
    1010 * Text Domain: fs-schema-wordpress
  • fudugo-schema/trunk/includes/class-fs-metabox.php

    r2455564 r2456178  
    322322            return $post_id;
    323323        }
    324         $post_type = esc_attr($_GET['post_type']);
     324        if(isset($_GET['post_type'])) {
     325            $post_type = $_GET['post_type'];
     326        }
    325327
    326328        // Check permissions
     
    335337        $schemaFields = $schemaModel->getSchemaFields();
    336338
    337         foreach ( $schemaFields as $schemaID => $schema ) {
    338             $schemaMetaId = "fssc_" . $schemaID;
    339             $data         = array();
    340             if ( ! empty( $schema['fields'] ) ) {
    341                 foreach ( $schema['fields'] as $fieldId => $fieldData ) {
    342                     $value            = ( ! empty( $_REQUEST[ $schemaMetaId ][ $fieldId ]) ? fssc_sanitizeInputValue($_REQUEST[ $schemaMetaId ][ $fieldId ],  $_REQUEST[ $schemaMetaId ][ $fieldId ]['type']) : null );
    343                     if(!is_array($value)){
    344                         $value        = $schemaModel->sanitize( $fieldData, $value );
    345                     }
    346                     $data[ $fieldId ] = $value;
     339        if( ! empty( $schemaFields )){
     340            foreach ( $schemaFields as $schemaID => $schema ) {
     341                $schemaMetaId = "fssc_" . $schemaID;
     342                $data         = array();
     343                if ( ! empty( $schema['fields'] ) ) {
     344                    foreach ( $schema['fields'] as $fieldId => $fieldData ) {
     345                        $value            = ( ! empty( $_REQUEST[ $schemaMetaId ][ $fieldId ]) ? fssc_sanitizeInputValue($_REQUEST[ $schemaMetaId ][ $fieldId ],  $_REQUEST[ $schemaMetaId ][ $fieldId ]['type']) : null );
     346                        if(!is_array($value)){
     347                            $value        = $schemaModel->sanitize( $fieldData, $value );
     348                        }
     349                        $data[ $fieldId ] = $value;
     350                    }
    347351                }
    348             }
    349             $meta[ $schemaMetaId ] = $data;
     352                $meta[ $schemaMetaId ] = $data;
     353            }
    350354        }
    351355        if ( count( $meta ) > 0 ) {
  • fudugo-schema/trunk/readme.txt

    r2455564 r2456178  
    22Contributors:  fudugo, neha13
    33Tags: json-ld, structured data, schema, rich snippets, Microdata, SEO, local seo, google, sitelinks, schema.org.
    4 Author: Fudugo Team
     4Author: Fudugo
    55Author URI: https://fudugo.com
    66Version: 1.0.0
Note: See TracChangeset for help on using the changeset viewer.