public/wordpress/wp-content/plugins/h5p/admin/class-h5p-content-admin.php
/**
   * Get library details through AJAX.
   *
   * @since 1.0.0
   */
Get library details through AJAX.
Get library details through AJAX .
public function ajax_libraries() {
    $editor = $this->get_h5peditor_instance();
    $name = filter_input(INPUT_GET, 'machineName', FILTER_SANITIZE_STRING);
    $major_version = filter_input(INPUT_GET, 'majorVersion', FILTER_SANITIZE_NUMBER_INT);
    $minor_version = filter_input(INPUT_GET, 'minorVersion', FILTER_SANITIZE_NUMBER_INT);
    if ($name) {
      $plugin = H5P_Plugin::get_instance();
      $plugin->get_h5p_instance('core');
      $editor->ajax->action(H5PEditorEndpoints::SINGLE_LIBRARY, $name,
        $major_version, $minor_version, $plugin->get_language(), '',
        $plugin->get_h5p_path(), filter_input(INPUT_GET, 'default-language')
      );
      new H5P_Event('library', NULL,
          NULL, NULL,
          $name, $major_version . '.' . $minor_version);
    }
    else {
      $editor->ajax->action(H5PEditorEndpoints::LIBRARIES);
    }
    exit;
  }
public function ajax_libraries ( ) { $ editor = $ this -> get_h5peditor_instance ( ) ; $ name = filter_input ( INPUT_GET , 'machineName' , FILTER_SANITIZE_STRING ) ; $ major_version = filter_input ( INPUT_GET , 'majorVersion' , FILTER_SANITIZE_NUMBER_INT ) ; $ minor_version = filter_input ( INPUT_GET , 'minorVersion' , FILTER_SANITIZE_NUMBER_INT ) ; if ( $ name ) { $ plugin = H5P_Plugin :: get_instance ( ) ; $ plugin -> get_h5p_instance ( 'core' ) ; $ editor -> ajax -> action ( H5PEditorEndpoints :: SINGLE_LIBRARY , $ name , $ major_version , $ minor_version , $ plugin -> get_language ( ) , '' , $ plugin -> get_h5p_path ( ) , filter_input ( INPUT_GET , 'default-language' ) ) ; new H5P_Event ( 'library' , NULL , NULL , NULL , $ name , $ major_version . '.' . $ minor_version ) ; } else { $ editor -> ajax -> action ( H5PEditorEndpoints :: LIBRARIES ) ; } exit ; }
Get library details through AJAX.
Get library details through AJAX .
// Get input // Retrieve single library if name is specified // Log library load // Otherwise retrieve all libraries