Plugin Directory

Changeset 2310255


Ignore:
Timestamp:
05/22/2020 02:57:03 PM (6 years ago)
Author:
macha795
Message:

Cocoonかどうかメッセージを表示する

Location:
cocoonnoticeareascheduler/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cocoonnoticeareascheduler/trunk/mch795-cocoon-notice-area-scheduler.php

    r2310226 r2310255  
    22/*
    33Plugin Name: CocoonNoticeAreaScheduler
    4 Description: Cocoon通知エリアスケジューラー.
     4Description: WordPressテーマ「Cocoon」で動作するプラグインです。Cocoonの通知エリアの設定を複数設定でき、表示スケジュールを管理できます。
    55Author: macha795
    6 Version: 0.0.5
     6Version: 0.0.6
    77Text Domain: mch795-cocoon-notice-area-scheduler
    88*/
  • cocoonnoticeareascheduler/trunk/mch795_cnas_main.php

    r2310226 r2310255  
    7777
    7878
     79            add_action( 'admin_notices', [$this, 'displaySettingCheckResult']);
    7980
    8081            // <editor-fold desc="style管理画面 新規追加・編集">
     
    392393        }
    393394
    394         return true;
     395        return false;
    395396    }
    396397
     
    937938    }
    938939
     940
     941    /**
     942     * 設定チェック
     943     */
     944    public function displaySettingCheckResult(){
     945        global $post_type;
     946        if( !isset( $post_type ) || self::APP_POST_TYPE !== $post_type ){
     947            return;
     948        }
     949        if (!$this->isCocoonTheme()) {
     950            $msg = $this->_t( 'テーマが Cocoon ではありません。' );
     951            echo <<<TEXT
     952<div class="notice notice-warning">
     953    <h3 class="title">{$msg}</h3>
     954</div>
     955TEXT;
     956        }
     957
     958        if ($this->isCocoonTheme() && !$this->isCocoonNoticeAreaVisible()) {
     959            $msg = $this->_t( 'Cocoon の通知エリアの表示が無効になっています。' );
     960            echo <<<TEXT
     961<div class="notice notice-warning">
     962    <h3 class="title">{$msg}</h3>
     963</div>
     964TEXT;
     965        }
     966    }
     967
     968
    939969    // </editor-fold>
    940970
  • cocoonnoticeareascheduler/trunk/readme.txt

    r2310226 r2310255  
    44Requires at least: 4.9
    55Tested up to: 5.4.1
    6 Stable tag: 0.0.5
     6Stable tag: 0.0.6
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.