Welcome, visitor! Log in
 

Source View: post_gallery

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: apply_filters( "hook_name", "what_to_filter" ).

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
592  * @since 2.5.0
593  *
594  * @param array $attr Attributes attributed to the shortcode.
595  * @return string HTML content to display gallery.
596  */
597 function gallery_shortcode($attr) {
598      global $post;
599
600      // Allow plugins/themes to override the default gallery template.
601      $output = apply_filters('post_gallery', '', $attr);
602      if ( $output != '' )
603           return $output;
604
605      // We're trusting author input, so let's at least make sure it looks like a valid orderby statement
606      if ( isset( $attr['orderby'] ) ) {
607           $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );
608           if ( !$attr['orderby'] )
609                unset( $attr['orderby'] );
610      }