(wp_is_mobile()) ? 1 : 0, 'is_rtl' => (is_rtl()) ? 1 : 0, )); } /** * Enqueue admin styles * * @package Album and Image Gallery Plus Lightbox * @since 1.0.0 */ function aigpl_admin_style( $hook ) { global $typenow; // If page is plugin setting page then enqueue script if( $typenow == AIGPL_POST_TYPE ) { // Registring admin script wp_register_style( 'aigpl-admin-style', AIGPL_URL.'assets/css/aigpl-admin.css', null, AIGPL_VERSION ); wp_enqueue_style( 'aigpl-admin-style' ); } } /** * Function to add script at admin side * * @package Album and Image Gallery Plus Lightbox * @since 1.0.0 */ function aigpl_admin_script( $hook ) { global $wp_version, $wp_query, $typenow; $new_ui = $wp_version >= '3.5' ? '1' : '0'; // Check wordpress version for older scripts if( $typenow == AIGPL_POST_TYPE ) { // Enqueue required inbuilt sctipt wp_enqueue_script( 'jquery-ui-sortable' ); // Registring admin script wp_register_script( 'aigpl-admin-script', AIGPL_URL.'assets/js/aigpl-admin.js', array('jquery'), AIGPL_VERSION, true ); wp_localize_script( 'aigpl-admin-script', 'AigplAdmin', array( 'new_ui' => $new_ui, 'img_edit_popup_text' => __('Edit Image in Popup', 'album-and-image-gallery-plus-lightbox'), 'attachment_edit_text' => __('Edit Image', 'album-and-image-gallery-plus-lightbox'), 'img_delete_text' => __('Remove Image', 'album-and-image-gallery-plus-lightbox'), )); wp_enqueue_script( 'aigpl-admin-script' ); wp_enqueue_media(); // For media uploader } } } $aigpl_script = new Aigpl_Script();