Get example

private function getListingPath(EntityDefinition $definition, string $path): Get
    {
        $humanReadableName = $this->convertToHumanReadable($definition->getEntityName());
        $tags = [$humanReadableName];

        if ($experimental = $this->isExperimental($definition)) {
            $tags[] = 'Experimental';
        }

        $schemaName = $this->snakeCaseToCamelCase($definition->getEntityName());

        return new Get([
            'summary' => 'List with basic information of ' . $humanReadableName . ' resources.' . ($experimental ? ' Experimental API, not part of our backwards compatibility promise, thus this API can introduce breaking changes at any time.' : ''),
            'description' => $definition->since() ? 'Available since: ' . $definition->since() : '',
            'tags' => $tags,
            'parameters' => $this->getDefaultListingParameter(),
            'operationId' => 'get' . $this->convertToOperationId($definition->getEntityName()) . 'List',
            'responses' => [
                Response::HTTP_OK => new OpenApiResponse([
                    'response' => Response::HTTP_OK,
                    'description' => 'List of ' . $humanReadableName . ' resources.',
                    'content' => [
                        'application/vnd.api+json' => [
                            

    public function get_name_for_update( $update ) {
        switch ( $update->type ) {
            case 'core':
                return 'WordPress'; // Not translated.
            case 'theme':
                $theme = wp_get_theme( $update->slug );
                if ( $theme->exists() ) {
                    return $theme->Get( 'Name' );
                }
                break;
            case 'plugin':
                $plugin_data = get_plugins( '/' . $update->slug );
                $plugin_data = reset( $plugin_data );
                if ( $plugin_data ) {
                    return $plugin_data['Name'];
                }
                break;
        }
        return '';
    }
$upgrader_item = $item;
        switch ( $type ) {
            case 'core':
                /* translators: %s: WordPress version. */
                $skin->feedback( __( 'Updating to WordPress %s' )$item->version );
                /* translators: %s: WordPress version. */
                $item_name = sprintf( __( 'WordPress %s' )$item->version );
                break;
            case 'theme':
                $upgrader_item = $item->theme;
                $theme         = wp_get_theme( $upgrader_item );
                $item_name     = $theme->Get( 'Name' );
                // Add the current version so that it can be reported in the notification email.                 $item->current_version = $theme->get( 'Version' );
                if ( empty( $item->current_version ) ) {
                    $item->current_version = false;
                }
                /* translators: %s: Theme name. */
                $skin->feedback( __( 'Updating theme: %s' )$item_name );
                break;
            case 'plugin':
                $upgrader_item = $item->plugin;
                $plugin_data   = get_plugin_data( $context . '/' . $upgrader_item );
                
Home | Imprint | This part of the site doesn't use cookies.