diff --git a/presenter.php b/presenter.php index e9fccfd..b166c91 100644 --- a/presenter.php +++ b/presenter.php @@ -56,6 +56,7 @@ protected function _init() { /** * Add filters and actions */ + add_filter( 'run_wptexturize', '__return_false' ); add_action( 'plugins_loaded', array( $this, 'upgrade_check' ) ); add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ) ); add_filter( 'single_template', array( $this, 'single_template' ) ); @@ -292,6 +293,9 @@ private function _get_html_from_slides( $slides ) { } $data_attributes = ''; + if ( $slide->markdown ) { + $data_attributes .= ' data-markdown'; + } if ( ! empty( $slide->data ) ) { foreach ( $slide->data as $data ) { $data_attributes .= sprintf( ' data-%1$s="%2$s"', esc_attr( $data->name ), esc_attr( $data->value ) ); @@ -333,6 +337,11 @@ private function _get_slides_from_post_data() { } } $slide->title = $slide_title; + if ( array_key_exists( 'slide-markdown', $_POST ) && array_key_exists( $num, $_POST['slide-markdown'] ) ) { + $slide->markdown = isset( $_POST['slide-markdown'][$num] )? (bool) $_POST['slide-notes'][$num] : false; + } else { + $slide->markdown = false; + } $slides[] = $slide; } @@ -470,6 +479,7 @@ public function slides_meta_box( $post ) { 'markdown' => false ); $slide->title = 'New Slide'; + $slide->markdown = false; array_unshift( $slides, $slide ); foreach ( $slides as $slide ) { @@ -487,6 +497,9 @@ public function slides_meta_box( $post ) { ); } ?> + if ( ! isset( $slide->markdown ) ) { + $slide->markdown = false; + }