'ASC', 'orderby' => 'menu_order ID', 'id' => $post -> ID, 'ids' => '', 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd', 'columns' => 3, 'size' => 'thumbnail', 'include' => '', 'exclude' => '', 'mythemes_style' => 'none' ) , $_attr ); /* NO MYTHEM.ES SHORTCODE EMBED */ if( isset( $attr[ 'mythemes_style' ] ) && $attr[ 'mythemes_style' ] == 'none' ){ return $rett; } $cols = $attr[ 'columns' ]; $ids = array(); if( empty( $attr[ 'ids' ] ) ){ $id = intval( $attr[ 'id' ] ); $orderby = $attr[ 'order' ]; $order = $attr[ 'order' ]; $include = $attr[ 'include' ]; $exclude = $attr[ 'exclude' ]; if ( 'RAND' == $attr[ 'order' ] ) { $orderby = 'none'; } if ( !empty( $include ) ) { $attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); } elseif ( !empty( $exclude ) ) { $attachments = get_children( array( 'post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); } else { $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby ) ); } foreach ( $attachments as $key => $val ) { $ids[ ] = $val -> ID ; } }else{ $ids = explode( ',' , $attr[ 'ids' ] ); } $rett = ''; return $rett; } static function admin_init() { add_action( 'wp_enqueue_media', array( 'mythemes_gallery' , 'admin_media' )); add_action( 'print_media_templates', array( 'mythemes_gallery' , 'admin_settings' )); } static function admin_media() { if ( ! isset( get_current_screen() -> id ) || get_current_screen() -> base != 'post' ) return; wp_enqueue_script( 'mythemes-gallery-settings', get_template_directory_uri() . '/media/_backend/js/gallery.js', array( 'media-views' ) ); } static function admin_settings() { if ( ! isset( get_current_screen() -> id ) || get_current_screen() -> base != 'post' ) return; ?>