$post ) ); } wp_enqueue_script( 'tiny_mce' ); _WP_Editors::editor_settings( esc_attr( $field['id'] ), $set ); // Only Localize Script Once Per Page if ( ! isset( $post->load_scripts ) ) { /** * Filter Tiny MCE Buttons for PNGX Editor Script * * @param array() an array of attributes to create the button * @param $post current post object */ $pngx_visual_editor_buttons = apply_filters( 'pngx_visual_editor_functions', array(), $post ); /** * Filter HTML Editor Buttons for PNGX Editor Script * * @param array() an array of attributes to create the button * @param $post current post object */ $pngx_html_editor_buttons = apply_filters( 'pngx_html_editor_functions', array(), $post ); /** * Variables for WP Editor Script */ $pngx_editor_vars = array( 'url' => get_home_url(), 'includes_url' => includes_url(), 'visual_editor_buttons' => $pngx_visual_editor_buttons, 'html_editor_buttons' => $pngx_html_editor_buttons, 'rich_editing' => get_user_meta( get_current_user_id(), 'rich_editing', true ), ); wp_localize_script( 'pngx-wp-editor', 'pngx_editor_vars', $pngx_editor_vars ); if ( is_object( $post ) ) { $post->load_scripts = true; } } $std = isset( $field['std'] ) ? $field['std'] : ''; $rows = isset( $field['rows'] ) ? $field['rows'] : 12; $cols = isset( $field['cols'] ) ? $field['cols'] : 50; $class = isset( $field['class'] ) ? $field['class'] : ''; $repeating = isset( $field['repeating'] ) ? '[]' : ''; ?> ' . esc_html( $field['desc'] ) . ''; } } }