WordPress.org

Make WordPress Core

Changeset 28510


Ignore:
Timestamp:
05/19/2014 05:46:56 AM (6 years ago)
Author:
wonderboymusic
Message:

Add access modifiers to methods/members in WP_Embed.

See #27881, #22234.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-embed.php

    r28378 r28510  
    88 */
    99class WP_Embed {
    10     var $handlers = array();
    11     var $post_ID;
    12     var $usecache = true;
    13     var $linkifunknown = true;
     10    public $handlers = array();
     11    public $post_ID;
     12    public $usecache = true;
     13    public $linkifunknown = true;
    1414
    1515    /**
    1616     * Constructor
    1717     */
    18     function __construct() {
     18    public function __construct() {
    1919        // Hack to get the [embed] shortcode to run before wpautop()
    2020        add_filter( 'the_content', array( $this, 'run_shortcode' ), 8 );
     
    4848     * @return string Content with shortcode parsed
    4949     */
    50     function run_shortcode( $content ) {
     50    public function run_shortcode( $content ) {
    5151        global $shortcode_tags;
    5252
     
    7070     * an AJAX request that will call WP_Embed::cache_oembed().
    7171     */
    72     function maybe_run_ajax_cache() {
     72    public function maybe_run_ajax_cache() {
    7373        $post = get_post();
    7474
     
    9696     * @param int $priority Optional. Used to specify the order in which the registered handlers will be tested (default: 10). Lower numbers correspond with earlier testing, and handlers with the same priority are tested in the order in which they were added to the action.
    9797     */
    98     function register_handler( $id, $regex, $callback, $priority = 10 ) {
     98    public function register_handler( $id, $regex, $callback, $priority = 10 ) {
    9999        $this->handlers[$priority][$id] = array(
    100100            'regex'    => $regex,
     
    109109     * @param int $priority Optional. The priority of the handler to be removed (default: 10).
    110110     */
    111     function unregister_handler( $id, $priority = 10 ) {
     111    public function unregister_handler( $id, $priority = 10 ) {
    112112        if ( isset($this->handlers[$priority][$id]) )
    113113            unset($this->handlers[$priority][$id]);
     
    140140     * @return string The embed HTML on success, otherwise the original URL.
    141141     */
    142     function shortcode( $attr, $url = '' ) {
     142    public function shortcode( $attr, $url = '' ) {
    143143        $post = get_post();
    144144
     
    241241     * @param int $post_ID Post ID to delete the caches for.
    242242     */
    243     function delete_oembed_caches( $post_ID ) {
     243    public function delete_oembed_caches( $post_ID ) {
    244244        $post_metas = get_post_custom_keys( $post_ID );
    245245        if ( empty($post_metas) )
     
    257257     * @param int $post_ID Post ID to do the caching for.
    258258     */
    259     function cache_oembed( $post_ID ) {
     259    public function cache_oembed( $post_ID ) {
    260260        $post = get_post( $post_ID );
    261261
     
    291291     * @return string Potentially modified $content.
    292292     */
    293     function autoembed( $content ) {
     293    public function autoembed( $content ) {
    294294        return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array( $this, 'autoembed_callback' ), $content );
    295295    }
     
    303303     * @return string The embed HTML on success, otherwise the original URL.
    304304     */
    305     function autoembed_callback( $match ) {
     305    public function autoembed_callback( $match ) {
    306306        $oldval = $this->linkifunknown;
    307307        $this->linkifunknown = false;
     
    318318     * @return string Linked URL or the original URL.
    319319     */
    320     function maybe_make_link( $url ) {
     320    public function maybe_make_link( $url ) {
    321321        $output = ( $this->linkifunknown ) ? '<a href="' . esc_url($url) . '">' . esc_html($url) . '</a>' : $url;
    322322
Note: See TracChangeset for help on using the changeset viewer.