public/wordpress/wp-content/plugins/h5p/admin/class-h5p-plugin-admin.php
/**
   * Print messages to admin UI.
   *
   * @since 1.3.0
   */
Print messages to admin UI.
Print messages to admin UI .
public function admin_notices() {
    global $wpdb;
    if (is_multisite()) {
      if (get_option('h5p_multisite_capabilities', 0) !== '1') {
        H5P_Plugin::assign_capabilities();
      }
    }
    else {
      if (get_option('h5p_multisite_capabilities', 0) === '1') {
        H5P_Plugin::assign_capabilities();
      }
    }
    $messages = array();
    $last_print = get_option('h5p_last_info_print', 0);
    if ($last_print !== H5P_Plugin::VERSION) {
      if ($last_print == 0) {
        $messages[] = __('Thank you for choosing H5P.', $this->plugin_slug);
        $messages[] = sprintf(wp_kses(__('You are ready to <a href="%s">start creating</a> interactive content. Check out our <a href="%s" target="_blank">Examples and Downloads</a> page for inspiration.', $this->plugin_slug), array('a' => array('href' => array(), 'target' => array()))), admin_url('admin.php?page=h5p_new'), esc_url('https://h5p.org/content-types-and-applications'));
      }
      else {
        $messages[] = __('Thank you for staying up to date with H5P.', $this->plugin_slug);
        $v = H5P_Plugin::split_version($last_print);
        if ($v) {
          if ($v->major < 1 || ($v->major === 1 && $v->minor < 7) || ($v->major === 1 && $v->minor === 7 && $v->patch < 8)) { 
            $messages[] = sprintf(wp_kses(__('You should <strong>upgrade your H5P content types!</strong> The old content types still work, but the authoring tool\'s look and feel is greatly improved with the new content types. Here\'s some more info about <a href="%s" target="_blank">upgrading the content types</a>.', $this->plugin_slug), array('strong' => array(), 'a' => array('href' => array(), 'target' => array()))), 'https://h5p.org/update-all-content-types');
          }
          if ($v->major < 1 || ($v->major === 1 && $v->minor < 8)) {
            if (!get_option('h5p_ext_communication', TRUE)) {
              $messages[] = sprintf(__('H5P now fetches content types directly from the H5P Hub. In order to do this, the H5P plugin will communicate with H5P.org once per day to fetch information about new and updated content types. It will send in anonymous data to the hub about H5P usage. You may disable the data contribution and/or the H5P Hub in the H5P settings.', $this->plugin_slug));
              delete_option('h5p_ext_communication');
              delete_option('h5p_update_available');
              delete_option('h5p_current_update');
              delete_option('h5p_update_available_path');
            }
          }
        }
      }
      $messages[] = sprintf(wp_kses(__('If you need any help you can always file a <a href="%s" target="_blank">Support Request</a>, check out our <a href="%s" target="_blank">Forum</a> or join the conversation in the <a href="%s" target="_blank">H5P Community Chat</a>.', $this->plugin_slug), array('a' => array('href' => array(), 'target' => array()))), esc_url('https://wordpress.org/support/plugin/h5p'), esc_url('https://h5p.org/forum'), esc_url('https://gitter.im/h5p/CommunityChat'));
      update_option('h5p_last_info_print', H5P_Plugin::VERSION);
    }
    $plugin = H5P_Plugin::get_instance();
    $core = $plugin->get_h5p_instance('core');
    if ($core->h5pF->getOption('hub_is_enabled') && $core->h5pF->getOption('check_h5p_requirements')) {
      $core->checkSetupForRequirements();
      $core->h5pF->setOption('check_h5p_requirements', FALSE);
    }
    if (!empty($messages)) {
      ?><div class="updated"><?php
      foreach ($messages as $message) {
        ?><p><?php print $message; ?></p><?php
      }
      ?></div><?php
    }
    self::print_messages();
  }
public function admin_notices ( ) { global $ wpdb ; if ( is_multisite ( ) ) { if ( get_option ( 'h5p_multisite_capabilities' , 0 ) !== '1' ) { H5P_Plugin :: assign_capabilities ( ) ; } } else { if ( get_option ( 'h5p_multisite_capabilities' , 0 ) === '1' ) { H5P_Plugin :: assign_capabilities ( ) ; } } $ messages = array ( ) ; $ last_print = get_option ( 'h5p_last_info_print' , 0 ) ; if ( $ last_print !== H5P_Plugin :: VERSION ) { if ( $ last_print == 0 ) { $ messages [ ] = __ ( 'Thank you for choosing H5P.' , $ this -> plugin_slug ) ; $ messages [ ] = sprintf ( wp_kses ( __ ( 'You are ready to <a href="%s">start creating</a> interactive content. Check out our <a href="%s" target="_blank">Examples and Downloads</a> page for inspiration.' , $ this -> plugin_slug ) , array ( 'a' => array ( 'href' => array ( ) , 'target' => array ( ) ) ) ) , admin_url ( 'admin.php?page=h5p_new' ) , esc_url ( 'https://h5p.org/content-types-and-applications' ) ) ; } else { $ messages [ ] = __ ( 'Thank you for staying up to date with H5P.' , $ this -> plugin_slug ) ; $ v = H5P_Plugin :: split_version ( $ last_print ) ; if ( $ v ) { if ( $ v -> major < 1 || ( $ v -> major === 1 && $ v -> minor < 7 ) || ( $ v -> major === 1 && $ v -> minor === 7 && $ v -> patch < 8 ) ) { $ messages [ ] = sprintf ( wp_kses ( __ ( 'You should <strong>upgrade your H5P content types!</strong> The old content types still work, but the authoring tool\'s look and feel is greatly improved with the new content types. Here\'s some more info about <a href="%s" target="_blank">upgrading the content types</a>.' , $ this -> plugin_slug ) , array ( 'strong' => array ( ) , 'a' => array ( 'href' => array ( ) , 'target' => array ( ) ) ) ) , 'https://h5p.org/update-all-content-types' ) ; } if ( $ v -> major < 1 || ( $ v -> major === 1 && $ v -> minor < 8 ) ) { if ( ! get_option ( 'h5p_ext_communication' , TRUE ) ) { $ messages [ ] = sprintf ( __ ( 'H5P now fetches content types directly from the H5P Hub. In order to do this, the H5P plugin will communicate with H5P.org once per day to fetch information about new and updated content types. It will send in anonymous data to the hub about H5P usage. You may disable the data contribution and/or the H5P Hub in the H5P settings.' , $ this -> plugin_slug ) ) ; delete_option ( 'h5p_ext_communication' ) ; delete_option ( 'h5p_update_available' ) ; delete_option ( 'h5p_current_update' ) ; delete_option ( 'h5p_update_available_path' ) ; } } } } $ messages [ ] = sprintf ( wp_kses ( __ ( 'If you need any help you can always file a <a href="%s" target="_blank">Support Request</a>, check out our <a href="%s" target="_blank">Forum</a> or join the conversation in the <a href="%s" target="_blank">H5P Community Chat</a>.' , $ this -> plugin_slug ) , array ( 'a' => array ( 'href' => array ( ) , 'target' => array ( ) ) ) ) , esc_url ( 'https://wordpress.org/support/plugin/h5p' ) , esc_url ( 'https://h5p.org/forum' ) , esc_url ( 'https://gitter.im/h5p/CommunityChat' ) ) ; update_option ( 'h5p_last_info_print' , H5P_Plugin :: VERSION ) ; } $ plugin = H5P_Plugin :: get_instance ( ) ; $ core = $ plugin -> get_h5p_instance ( 'core' ) ; if ( $ core -> h5pF -> getOption ( 'hub_is_enabled' ) && $ core -> h5pF -> getOption ( 'check_h5p_requirements' ) ) { $ core -> checkSetupForRequirements ( ) ; $ core -> h5pF -> setOption ( 'check_h5p_requirements' , FALSE ) ; } if ( ! empty ( $ messages ) ) { ?> <div class="updated"> <?php foreach ( $ messages as $ message ) { ?> <p> <?php print $ message ; ?> </p> <?php } ?> </div> <?php } self :: print_messages ( ) ; }
Print messages to admin UI.
Print messages to admin UI .
// Check to make sure that the correct capabilities are assigned // Changed from single site to multsite, re-assign capabilities // Changed from multisite to single site, re-assign capabilities // Gather all messages before printing // Always print a message after installing or upgrading // A new installation of the plugin // Looks like we've just updated, always thank the user for updating. // Check for any version specific messages to show // < 1.7.8 // Extra warning that content types should be updated in order to look good with the new editor design changes // Notify about H5P Hub communication changes // Delete old variable // Always offer help // Print all messages // Print any other messages