statusses = apply_filters( 'apermo-adminbar-statusses', $statusses ); } /** * Load the JS if on options-reading */ public function watermark_js() { if ( ! is_admin() && is_singular() ) { global $post; if ( 'publish' !== $post->post_status ) { wp_enqueue_script( 'apermo-adminbar-watermark', plugins_url( '../js/watermark.js', __FILE__ ), array( 'jquery' ), '', true ); } } } public function watermark_localize() { if ( ! is_admin() && is_singular() ) { global $post; if ( 'publish' !== $post->post_status ) { $data['post_status'] = $post->post_status; $data['post_status_nice'] = $this->statusses[ $post->post_status ]; wp_localize_script( 'apermo-adminbar-watermark', 'apermo_adminbar_watermark', $data ); } } } }