[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-admin/includes/ -> class-wp-press-this.php (summary)

Press This class and display functionality

File Size: 1538 lines (50 kb)
Included or required:0 times
Referenced: 2 times
Includes or requires: 0 files

Defines 1 class

WP_Press_This:: (25 methods):
  __construct()
  site_settings()
  side_load_images()
  save_post()
  add_category()
  fetch_source_html()
  _limit_array()
  _limit_string()
  _limit_url()
  _limit_img()
  _limit_embed()
  _process_meta_entry()
  source_data_fetch_fallback()
  merge_or_fetch_data()
  add_editor_style()
  post_formats_html()
  categories_html()
  tags_html()
  get_embeds()
  get_images()
  get_canonical_link()
  get_source_site_name()
  get_suggested_title()
  get_suggested_content()
  html()


Class: WP_Press_This  - X-Ref

Press This class.

__construct()   X-Ref
Constructor.

since: 4.2.0

site_settings()   X-Ref
App and site settings data, including i18n strings for the client-side.

return: array Site settings.
since: 4.2.0

side_load_images( $post_id, $content = '' )   X-Ref
Get the source's images and save them locally, for posterity, unless we can't.

return: string New markup with old image URLs replaced with the local attachment ones if swapped.
since: 4.2.0
param: int    $post_id Post ID.
param: string $content Optional. Current expected markup for Press This. Expects slashed. Default empty.

save_post()   X-Ref
Ajax handler for saving the post as draft or published.

since: 4.2.0

add_category()   X-Ref
Ajax handler for adding a new category.

since: 4.2.0

fetch_source_html( $url )   X-Ref
Downloads the source's HTML via server-side call for the given URL.

return: string Source's HTML sanitized markup
since: 4.2.0
param: string $url URL to scan.

_limit_array( $value )   X-Ref
Utility method to limit an array to 50 values.

return: array Original array if fewer than 50 values, limited array, empty array otherwise.
since: 4.2.0
param: array $value Array to limit.

_limit_string( $value )   X-Ref
Utility method to limit the length of a given string to 5,000 characters.

return: bool|int|string If boolean or integer, that value. If a string, the original value
since: 4.2.0
param: string $value String to limit.

_limit_url( $url )   X-Ref
Utility method to limit a given URL to 2,048 characters.

return: string Escaped URL if of valid length (< 2048) and makeup. Empty string otherwise.
since: 4.2.0
param: string $url URL to check for length and validity.

_limit_img( $src )   X-Ref
Utility method to limit image source URLs.

Excluded URLs include share-this type buttons, loaders, spinners, spacers, WordPress interface images,
tiny buttons or thumbs, mathtag.com or quantserve.com images, or the WordPress.com stats gif.

return: string If not matched an excluded URL type, the original URL, empty string otherwise.
since: 4.2.0
param: string $src Image source URL.

_limit_embed( $src )   X-Ref
Limit embed source URLs to specific providers.

Not all core oEmbed providers are supported. Supported providers include YouTube, Vimeo,
Daily Motion, SoundCloud, and Twitter.

return: string If not from a supported provider, an empty string. Otherwise, a reformatted embed URL.
since: 4.2.0
param: string $src Embed source URL.

_process_meta_entry( $meta_name, $meta_value, $data )   X-Ref
Process a meta data entry from the source.

return: array Processed data array.
since: 4.2.0
param: string $meta_name  Meta key name.
param: mixed  $meta_value Meta value.
param: array  $data       Associative array of source data.

source_data_fetch_fallback( $url, $data = array()   X-Ref
Fetches and parses _meta, _images, and _links data from the source.

return: array New data array.
since: 4.2.0
param: string $url  URL to scan.
param: array  $data Optional. Existing data array if you have one. Default empty array.

merge_or_fetch_data()   X-Ref
Handles backward-compat with the legacy version of Press This by supporting its query string params.

return: array
since: 4.2.0

add_editor_style( $styles )   X-Ref
Adds another stylesheet inside TinyMCE.

return: string Possibly modified stylesheets list.
since: 4.2.0
param: string $styles URL to editor stylesheet.

post_formats_html( $post )   X-Ref
Outputs the post format selection HTML.

since: 4.2.0
param: WP_Post $post Post object.

categories_html( $post )   X-Ref
Outputs the categories HTML.

since: 4.2.0
param: WP_Post $post Post object.

tags_html( $post )   X-Ref
Outputs the tags HTML.

since: 4.2.0
param: WP_Post $post Post object.

get_embeds( $data )   X-Ref
Get a list of embeds with no duplicates.

return: array Embeds selected to be available.
since: 4.2.0
param: array $data The site's data.

get_images( $data )   X-Ref
Get a list of images with no duplicates.

return: array
since: 4.2.0
param: array $data The site's data.

get_canonical_link( $data )   X-Ref
Gets the source page's canonical link, based on passed location and meta data.

return: string Discovered canonical URL, or empty
since: 4.2.0
param: array $data The site's data.

get_source_site_name( $data )   X-Ref
Gets the source page's site name, based on passed meta data.

return: string Discovered site name, or empty
since: 4.2.0
param: array $data The site's data.

get_suggested_title( $data )   X-Ref
Gets the source page's title, based on passed title and meta data.

return: string Discovered page title, or empty
since: 4.2.0
param: array $data The site's data.

get_suggested_content( $data )   X-Ref
Gets the source page's suggested content, based on passed data (description, selection, etc).

Features a blockquoted excerpt, as well as content attribution, if any.

return: string Discovered content, or empty
since: 4.2.0
param: array $data The site's data.

html()   X-Ref
Serves the app's base HTML, which in turns calls the load script.

since: 4.2.0



Generated: Sun Sep 24 01:00:03 2017 Cross-referenced by PHPXref 0.7.1