Plugin Directory

Changeset 2645866


Ignore:
Timestamp:
12/17/2021 03:44:36 PM (4 years ago)
Author:
tildapublishing
Message:

0.3.03 - fix warning meta

Location:
tilda-publishing
Files:
25 added
4 edited

Legend:

Unmodified
Added
Removed
  • tilda-publishing/trunk/class.tilda-admin.php

    r2643950 r2645866  
    3737            self::$ts_start_plugin = time();
    3838        }
    39 
    40         // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);
    4139
    4240        self::$initiated = true;
     
    123121            }
    124122        }
    125         //map_page_post ready to save
    126123
    127124        //If everything goes fine until this, then save new data structure
     
    157154    public static function admin_init()
    158155    {
    159         // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);
    160 
    161156        register_setting(
    162157            static::OPTION_KEYS,
     
    194189    public static function admin_menu()
    195190    {
    196         // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);
    197191        self::load_menu();
    198192    }
     
    200194    public static function load_menu()
    201195    {
    202         // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);
    203196        add_submenu_page(
    204197            'options-general.php',
     
    213206    public static function add_meta_box()
    214207    {
    215         // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);
    216 
    217208        $post = get_post();
    218209        $data = get_post_meta($post->ID, '_tilda', true);
     
    220211        $options = get_option(Tilda_Admin::OPTION_OPTIONS);
    221212        $screens = (isset($options['enabledposttypes'])) ? $options['enabledposttypes'] : array('post','page');
    222 
    223         //$screens = array('post', 'page');
    224 
    225213
    226214        foreach ($screens as $screen) {
     
    235223                    'high'
    236224                );
    237             };
     225            }
    238226            if (isset($data["status"]) && $data["status"] == 'on') {
    239227                add_meta_box(
     
    245233                    'high'
    246234                );
    247             };
     235            }
    248236        }
    249237    }
     
    251239    public static function pages_list_callback($post)
    252240    {
    253         // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);
    254 
    255241        $data = get_post_meta($post->ID, '_tilda', true);
    256         $page_id = isset($data["page_id"]) ? $data["page_id"] : false;
    257         $project_id = isset($data["project_id"]) ? $data["project_id"] : false;
     242        //$page_id = isset($data["page_id"]) ? $data["page_id"] : false;
     243        //$project_id = isset($data["project_id"]) ? $data["project_id"] : false;
    258244
    259245        if (isset($data['update_data']) && $data['update_data'] == 'update_data') {
     
    277263    public static function save_tilda_data($postID)
    278264    {
    279         // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);
    280 
    281265        if (!isset($_POST['tilda'])) {
    282266            return;
     
    307291    public static function admin_enqueue_scripts($hook)
    308292    {
    309         // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);
    310 
    311293        wp_register_style('tilda_css', TILDA_PLUGIN_URL . 'css/styles.css', array() , '3');
    312294        wp_enqueue_style('tilda_css');
     
    358340    public static function initialize()
    359341    {
    360         // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);
    361342        $keys = Tilda::get_local_keys();
    362343
     
    392373    private static function scandir($dir)
    393374    {
    394         // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);
    395 
    396375        $list = scandir($dir);
    397376        return array_values($list);
     
    400379    private static function clear_dir($dir)
    401380    {
    402         // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);
    403 
    404381        $list = self::scandir($dir);
    405382
     
    677654            }
    678655        }
    679 
    680         //Those settings moved to project level
    681         /*if (empty($input['acceptcssinlist']) || $input['acceptcssinlist'] != 'no') {
    682             $input['acceptcssinlist'] = 'yes';
    683         } else {
    684             $input['acceptcssinlist'] = 'no';
    685         }
    686 
    687         if (empty($input['type_stored']) || $input['type_stored'] != 'html') {
    688             $input['type_stored'] = 'meta';
    689         } else {
    690             $input['type_stored'] = 'html';
    691         }*/
    692656
    693657        if (isset($input['secret_key'])) {
     
    812776    }
    813777
    814     private static function validate_required_libs(){
    815         // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);
    816 
     778    private static function validate_required_libs()
     779    {
    817780        $libs = self::$libs;
    818         foreach ($libs as $lib_name){
    819             if(!extension_loaded($lib_name)){
    820                 Tilda::$errors->add( 'no_library',__('Not found library ','tilda').$lib_name);
    821             }
    822         }
    823 
    824 
     781        foreach ($libs as $lib_name) {
     782            if (!extension_loaded($lib_name)) {
     783                Tilda::$errors->add('no_library', __('Not found library ', 'tilda') . $lib_name);
     784            }
     785        }
    825786    }
    826787
    827788    public static function display_configuration_page()
    828789    {
    829 //        self::validate_required_libs();
    830 
    831790        self::view('configuration');
    832791    }
     
    834793    public static function switcher_callback($post)
    835794    {
    836         // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);
    837 
    838795        $data = get_post_meta($post->ID, '_tilda', true);
    839796        if (! is_array($data)) {
     
    849806    public static function view($name, array $args = array())
    850807    {
    851         // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);
    852 
    853808        $args = apply_filters('tilda_view_arguments', $args, $name);
    854809
     
    897852        if (!is_dir($upload_dir)) {
    898853            wp_mkdir_p($upload_dir);
    899             // mkdir($upload_dir, 0755);
    900         }
    901 
    902         // self::clear_dir($upload_dir);
     854        }
    903855
    904856        $css_path = $upload_dir . 'css/';
     
    908860        if (!is_dir($css_path)) {
    909861            wp_mkdir_p($css_path);
    910             //mkdir($css_path, 0755);
    911862        }
    912863        if (!is_dir($js_path)) {
    913             //mkdir($js_path, 0755);
    914864            wp_mkdir_p($js_path);
    915865        }
    916866        if (!is_dir($pages_path)) {
    917             //mkdir($pages_path, 0755);
    918867            wp_mkdir_p($pages_path);
    919868        }
     
    10751024        if (is_wp_error($project)) {
    10761025            return $project;
    1077             //$arResult['error'] = __("Error. Can't find project with this 'projectid' parameter");
    1078             //echo json_encode($arResult);
    1079             //wp_die();
    10801026        }
    10811027        $tildaoptions = get_option(Tilda_Admin::OPTION_OPTIONS);
     
    10851031        if (is_wp_error($tildapage)) {
    10861032            return $tildapage;
    1087             //$arResult['error'] = __("Error. Can't find page with this 'pageid' parameter");
    1088             //echo json_encode($arResult);
    1089             //wp_die();
    10901033        }
    10911034        // ||s|| is custom escaping symbol used to bypass '<\/script>' text from wordpress engine processing
     
    11081051                $tildapage->html = str_replace("||imgsvalue-{$key}||", $match, $tildapage->html);
    11091052            }
     1053        }
     1054
     1055        //remove all css <link> occurrences that was already added to the <header> tag
     1056        foreach ($tildapage->css as $css) {
     1057            $tildapage->html = str_replace('<link rel="stylesheet" href="' . $css->to . '">', '', $tildapage->html);
    11101058        }
    11111059
     
    12261174
    12271175        $meta['current_page'] = $tildapage;
    1228         //unset($meta['current_page']->html);
    12291176        update_post_meta($post_id, '_tilda', $meta);
    12301177
     
    13141261        if (!session_id()) {
    13151262            session_start();
    1316             /*if (session_status() != PHP_SESSION_ACTIVE) {
    1317                 Tilda::$errors->add( 'no_start_session', 'Cannoyt start session.');
    1318                 echo Tilda::json_errors();
    1319                 wp_die();
    1320             }*/
    13211263        }
    13221264
     
    13351277        $arResult['post_id'] = $post_id;
    13361278
    1337         //$arResult['dump'] = $arDownload;
    1338 
    13391279        echo json_encode($arResult);
    13401280        wp_die();
     
    13551295        if (!session_id()) {
    13561296            session_start();
    1357             /*if (session_status() != PHP_SESSION_ACTIVE) {
    1358                 Tilda::$errors->add( 'no_start_session', 'Cannoyt start session.');
    1359                 echo Tilda::json_errors();
    1360                 wp_die();
    1361             }*/
    13621297        }
    13631298
  • tilda-publishing/trunk/class.tilda.php

    r2643304 r2645866  
    259259        if ($post) {
    260260            $data = get_post_meta($post->ID, '_tilda', true);
     261            if (empty($data['project_id'])) {
     262                $data['project_id'] = (!empty($data['current_page']->projectid)) ? $data['current_page']->projectid : null;
     263            }
    261264
    262265            $key_id = Tilda::get_key_for_project_id($data['project_id']);
     
    324327        }
    325328        $data = get_post_meta($post->ID, '_tilda', true);
     329        if (empty($data['project_id'])) {
     330            $data['project_id'] = (!empty($data['current_page']->projectid)) ? $data['current_page']->projectid : null;
     331        }
    326332
    327333        $key_id = Tilda::get_key_for_project_id($data['project_id']);
  • tilda-publishing/trunk/readme.txt

    r2643950 r2645866  
    55Requires at least: 3.0.1
    66Tested up to: 4.9.6
    7 Stable tag: 0.3.02
     7Stable tag: 0.3.03
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6262
    6363== Changelog ==
     64
     65= 0.3.03 =
     66* Update 0.3.03 - minor fix warning on post meta without project_id
    6467
    6568= 0.3.02 =
  • tilda-publishing/trunk/tilda-wordpress-plugin.php

    r2643950 r2645866  
    33Plugin Name: Tilda Publishing
    44Description: Tilda позволяет делать яркую подачу материала, качественную верстку и эффектную типографику, близкую к журнальной. Каким бы ни был ваш контент — Tilda знает, как его показать. С чего начать: 1) Нажмите ссылку «Активировать» слева от этого описания; 2) <a href="http://www.tilda.cc/" target="_blank">Зарегистрируйтесь</a>, чтобы получить API-ключ; 3) Перейдите на страницу настройки Tilda Publishing и введите свой API-ключ. Читайте подробную инструкцию по подключению.
    5 Version: 0.3.02
     5Version: 0.3.03
    66Author: Tilda Publishing
    77License: GPLv2 or later
    88Text Domain: api tilda
     9
     10Update 0.3.03 - fix warning on post meta without project_id
    911
    1012Update 0.3.02 - fix ZeroBlock's gallery import
     
    8890}
    8991
    90 define( 'TILDA_VERSION', '0.3.02' );
     92define( 'TILDA_VERSION', '0.3.03' );
    9193define( 'TILDA_MINIMUM_WP_VERSION', '3.1' );
    9294define( 'TILDA_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.