Plugin Directory

Changeset 2571586


Ignore:
Timestamp:
07/24/2021 11:50:28 PM (5 years ago)
Author:
timvaniersel
Message:

Fix saving issue

Location:
websitescanner-custom-schema/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • websitescanner-custom-schema/trunk/README.txt

    r2548775 r2571586  
    44Tags: schema, structured data, schema markup, json-ld, rich snippets, custom schema
    55Requires at least: 3.0.1
    6 Tested up to: 5.7
    7 Stable tag: 1.3.4
     6Tested up to: 5.8
     7Stable tag: 1.3.7
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • websitescanner-custom-schema/trunk/admin/class-websitescanner-custom-schema-admin.php

    r2571580 r2571586  
    9595    public function options_update() {
    9696            if (isset($_POST[$this->plugin_name])){
    97                 $data = $this->validate($data);
     97                $data = $this->validate($_POST[$this->plugin_name]);
    9898                if ($data) {
    9999                    update_post_meta( get_the_ID(), 'websitescanner_custom_schema_post_data', $data );
     
    111111
    112112        $valid = array();
     113            error_log("nonce isset");
    113114            //does it exist?
    114115            if(isset($input['custom_schema_0'])){
  • websitescanner-custom-schema/trunk/public/class-websitescanner-custom-schema-public.php

    r2214917 r2571586  
    5757    public function get_page_json_ld(){
    5858        // Get post id
    59         $post_ID = url_to_postid((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
     59        $post_ID = get_queried_object_id();
    6060
    6161        // get page options
     
    6464        //if page options...
    6565        if ($page_options) {
    66 
     66            $html = '';
    6767            if (isset($page_options['custom_schema_0']) && $page_options['custom_schema_0'] != ""){
    68                 echo "<script type=\"application/ld+json\">" . wp_unslash(json_decode($page_options['custom_schema_0'])) . "</script>";
     68                $html .=  "<script type=application/ld+json>" . wp_unslash(json_decode($page_options['custom_schema_0'])) . "</script>";
    6969            }
    7070            if (isset($page_options['custom_schema_1']) && $page_options['custom_schema_1'] != ""){
    71                 echo "<script type=\"application/ld+json\">" . wp_unslash(json_decode($page_options['custom_schema_1']))  . "</script>";
     71                $html .= "<script type=\"application/ld+json\">" . wp_unslash(json_decode($page_options['custom_schema_1']))  . "</script>";
    7272            }
    7373            if (isset($page_options['custom_schema_2']) && $page_options['custom_schema_2'] != ""){
    74                 echo "<script type=\"application/ld+json\">" . wp_unslash(json_decode($page_options['custom_schema_2']))  . "</script>";
     74                $html .= "<script type=\"application/ld+json\">" . wp_unslash(json_decode($page_options['custom_schema_2']))  . "</script>";
    7575            }
     76            echo $html;
    7677        }
    7778    }
  • websitescanner-custom-schema/trunk/websitescanner-custom-schema.php

    r2571580 r2571586  
    1717 * Plugin URI:        https://plugin.nl/en/websitescanner-custom-schema-plugin/
    1818 * Description:       Adds a field to the editor for custom JSON-ld schema markup.
    19  * Version:           1.3.6
     19 * Version:           1.3.7
    2020 * Author:            Plugin.nl
    2121 * Author URI:        https://plugin.nl/en/
     
    3636 * Rename this for your plugin and update it as you release new versions.
    3737 */
    38 define( 'WEBSITESCANNER_CUSTOM_SCHEMA_VERSION', '1.3.6' );
     38define( 'WEBSITESCANNER_CUSTOM_SCHEMA_VERSION', '1.3.7' );
    3939/**
    4040 * The core plugin class that is used to define internationalization,
Note: See TracChangeset for help on using the changeset viewer.