="message collapsing has-emoji"> d01d7cf85d first commit лет назад: 4 https-migration.php d01d7cf85d first commit лет назад: 4 kses.php d01d7cf85d first commit лет назад: 4 l10n.php d01d7cf85d first commit лет назад: 4 link-template.php d01d7cf85d first commit лет назад: 4 load.php d01d7cf85d first commit лет назад: 4 locale.php d01d7cf85d first commit лет назад: 4 media-template.php d01d7cf85d first commit лет назад: 4 media.php d01d7cf85d first commit лет назад: 4 meta.php d01d7cf85d first commit лет назад: 4 ms-blogs.php d01d7cf85d first commit лет назад: 4 ms-default-constants.php d01d7cf85d first commit лет назад: 4 ms-default-filters.php d01d7cf85d first commit лет назад: 4 ms-deprecated.php d01d7cf85d first commit лет назад: 4 ms-files.php d01d7cf85d first commit лет назад: 4 ms-functions.php d01d7cf85d first commit лет назад: 4 ms-load.php d01d7cf85d first commit лет назад: 4 ms-network.php d01d7cf85d first commit лет назад: 4 ms-settings.php d01d7cf85d first commit лет назад: 4 ms-site.php d01d7cf85d first commit лет назад: 4 nav-menu-template.php d01d7cf85d first commit лет назад: 4 nav-menu.php d01d7cf85d first commit лет назад: 4 option.php d01d7cf85d first commit лет назад: 4 pluggable-deprecated.php d01d7cf85d first commit лет назад: 4 pluggable.php d01d7cf85d first commit лет назад: 4 plugin.php d01d7cf85d first commit лет назад: 4 post-formats.php d01d7cf85d first commit лет назад: 4 post-template.php d01d7cf85d first commit лет назад: 4 post-thumbnail-template.php d01d7cf85d first commit лет назад: 4 post.php d01d7cf85d first commit лет назад: 4 query.php d01d7cf85d first commit лет назад: 4 registration-functions.php d01d7cf85d first commit лет назад: 4 registration.php d01d7cf85d first commit лет назад: 4 rest-api.php d01d7cf85d first commit лет назад: 4 revision.php d01d7cf85d first commit лет назад: 4 rewrite.php d01d7cf85d first commit лет назад: 4 robots-template.php d01d7cf85d first commit лет назад: 4 rss-functions.php d01d7cf85d first commit лет назад: 4 rss.php d01d7cf85d first commit лет назад: 4 script-loader.php d01d7cf85d first commit лет назад: 4 session.php d01d7cf85d first commit лет назад: 4 shortcodes.php d01d7cf85d first commit лет назад: 4 sitemaps.php d01d7cf85d first commit лет назад: 4 spl-autoload-compat.php d01d7cf85d first commit лет назад: 4 taxonomy.php d01d7cf85d first commit лет назад: 4 template-canvas.php d01d7cf85d first commit лет назад: 4 template-loader.php d01d7cf85d first commit лет назад: 4 template.php d01d7cf85d first commit лет назад: 4 theme-i18n.json d01d7cf85d first commit лет назад: 4 theme-templates.php d01d7cf85d first commit лет назад: 4 theme.json d01d7cf85d first commit лет назад: 4 theme.php d01d7cf85d first commit лет назад: 4 update.php d01d7cf85d first commit лет назад: 4 user.php d01d7cf85d first commit лет назад: 4 vars.php d01d7cf85d first commit лет назад: 4 version.php d01d7cf85d first commit лет назад: 4 widgets.php d01d7cf85d first commit лет назад: 4 wlwmanifest.xml d01d7cf85d first commit лет назад: 4 wp-db.php d01d7cf85d first commit лет назад: 4 wp-diff.php d01d7cf85d first commit лет назад: 4 tum/whitesports - Gogs: Simplico Git Service

Nav apraksta

class.wpcom-json-api-get-customcss.php 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * Custom Css endpoint
  4. *
  5. * https://public-api.wordpress.com/rest/v1.1/sites/$site/customcss/
  6. */
  7. new WPCOM_JSON_API_Get_CustomCss_Endpoint( array (
  8. 'description' => 'Retrieve custom-css data for a site.',
  9. 'group' => '__do_not_document',
  10. 'stat' => 'customcss:1:get',
  11. 'method' => 'GET',
  12. 'min_version' => '1.1',
  13. 'path' => '/sites/%s/customcss',
  14. 'path_labels' => array(
  15. '$site' => '(string) Site ID or domain.',
  16. ),
  17. 'response_format' => array(
  18. 'css' => '(string) The raw CSS.',
  19. 'preprocessor' => '(string) The name of the preprocessor if any.',
  20. 'add_to_existing' => '(bool) False to skip the existing styles.',
  21. ),
  22. 'example_request' => 'https://public-api.wordpress.com/rest/v1.1/sites/12345678/customcss',
  23. 'example_response' => '
  24. {
  25. "css": ".site-title { color: #fff; }",
  26. "preprocessor": "sass",
  27. "add_to_existing": "true"
  28. }'
  29. ) );
  30. class WPCOM_JSON_API_Get_CustomCss_Endpoint extends WPCOM_JSON_API_Endpoint {
  31. /**
  32. * API callback.
  33. */
  34. function callback( $path = '', $blog_id = 0 ) {
  35. // Switch to the given blog.
  36. $blog_id = $this->api->switch_to_blog_and_validate_user( $this->api->get_blog_id( $blog_id ) );
  37. if ( is_wp_error( $blog_id ) ) {
  38. return $blog_id;
  39. }
  40. $args = array(
  41. 'css' => Jetpack_Custom_CSS::get_css(),
  42. 'preprocessor' => Jetpack_Custom_CSS::get_preprocessor_key(),
  43. 'add_to_existing' => ! Jetpack_Custom_CSS::skip_stylesheet(),
  44. );
  45. $defaults = array(
  46. 'css' => '',
  47. 'preprocessor' => '',
  48. 'add_to_existing' => true,
  49. );
  50. return wp_parse_args( $args, $defaults );
  51. }
  52. }