@@ -84,90 +84,90 @@ discard block |
||
| 84 | 84 | /** |
| 85 | 85 | * Setup the "course" post type, it's admin menu item and the appropriate labels and permissions. |
| 86 | 86 | * @since 1.0.0 |
| 87 | - * @uses Sensei() |
|
| 87 | + * @uses Sensei() |
|
| 88 | 88 | * @return void |
| 89 | 89 | */ |
| 90 | 90 | public function setup_course_post_type () { |
| 91 | 91 | |
| 92 | 92 | $args = array( |
| 93 | - 'labels' => $this->create_post_type_labels( 'course', $this->labels['course']['singular'], $this->labels['course']['plural'], $this->labels['course']['menu'] ), |
|
| 94 | - 'public' => true, |
|
| 95 | - 'publicly_queryable' => true, |
|
| 96 | - 'show_ui' => true, |
|
| 97 | - 'show_in_menu' => true, |
|
| 98 | - 'show_in_admin_bar' => true, |
|
| 99 | - 'query_var' => true, |
|
| 100 | - 'rewrite' => array( |
|
| 101 | - 'slug' => esc_attr( apply_filters( 'sensei_course_slug', _x( 'course', 'post type single url base', 'woothemes-sensei' ) ) ) , |
|
| 102 | - 'with_front' => true, |
|
| 103 | - 'feeds' => true, |
|
| 104 | - 'pages' => true |
|
| 105 | - ), |
|
| 106 | - 'map_meta_cap' => true, |
|
| 107 | - 'capability_type' => 'course', |
|
| 108 | - 'has_archive' => $this->get_course_post_type_archive_slug(), |
|
| 109 | - 'hierarchical' => false, |
|
| 110 | - 'menu_position' => 51, |
|
| 111 | - 'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail' ) |
|
| 93 | + 'labels' => $this->create_post_type_labels( 'course', $this->labels['course']['singular'], $this->labels['course']['plural'], $this->labels['course']['menu'] ), |
|
| 94 | + 'public' => true, |
|
| 95 | + 'publicly_queryable' => true, |
|
| 96 | + 'show_ui' => true, |
|
| 97 | + 'show_in_menu' => true, |
|
| 98 | + 'show_in_admin_bar' => true, |
|
| 99 | + 'query_var' => true, |
|
| 100 | + 'rewrite' => array( |
|
| 101 | + 'slug' => esc_attr( apply_filters( 'sensei_course_slug', _x( 'course', 'post type single url base', 'woothemes-sensei' ) ) ) , |
|
| 102 | + 'with_front' => true, |
|
| 103 | + 'feeds' => true, |
|
| 104 | + 'pages' => true |
|
| 105 | + ), |
|
| 106 | + 'map_meta_cap' => true, |
|
| 107 | + 'capability_type' => 'course', |
|
| 108 | + 'has_archive' => $this->get_course_post_type_archive_slug(), |
|
| 109 | + 'hierarchical' => false, |
|
| 110 | + 'menu_position' => 51, |
|
| 111 | + 'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail' ) |
|
| 112 | 112 | ); |
| 113 | 113 | |
| 114 | - /** |
|
| 115 | - * Filter the arguments passed in when registering the Sensei Course post type. |
|
| 116 | - * |
|
| 117 | - * @since 1.9.0 |
|
| 118 | - * @param array $args |
|
| 119 | - */ |
|
| 114 | + /** |
|
| 115 | + * Filter the arguments passed in when registering the Sensei Course post type. |
|
| 116 | + * |
|
| 117 | + * @since 1.9.0 |
|
| 118 | + * @param array $args |
|
| 119 | + */ |
|
| 120 | 120 | register_post_type( 'course', apply_filters( 'sensei_register_post_type_course', $args ) ); |
| 121 | 121 | |
| 122 | 122 | } // End setup_course_post_type() |
| 123 | 123 | |
| 124 | - /** |
|
| 125 | - * Figure out of the course post type has an archive and what it should be. |
|
| 126 | - * |
|
| 127 | - * This function should return 'courses' or the page_uri for the course page setting. |
|
| 128 | - * |
|
| 129 | - * For backward compatibility sake ( pre 1.9 )If the course page set in settings |
|
| 130 | - * still has any of the old shortcodes: [newcourses][featuredcourses][freecourses][paidcourses] the |
|
| 131 | - * page slug will not be returned. For any other pages without it the page URI will be returned. |
|
| 132 | - * |
|
| 133 | - * |
|
| 134 | - * @sine 1.9.0 |
|
| 135 | - * |
|
| 136 | - * |
|
| 137 | - * @return false|string |
|
| 138 | - */ |
|
| 139 | - public function get_course_post_type_archive_slug(){ |
|
| 124 | + /** |
|
| 125 | + * Figure out of the course post type has an archive and what it should be. |
|
| 126 | + * |
|
| 127 | + * This function should return 'courses' or the page_uri for the course page setting. |
|
| 128 | + * |
|
| 129 | + * For backward compatibility sake ( pre 1.9 )If the course page set in settings |
|
| 130 | + * still has any of the old shortcodes: [newcourses][featuredcourses][freecourses][paidcourses] the |
|
| 131 | + * page slug will not be returned. For any other pages without it the page URI will be returned. |
|
| 132 | + * |
|
| 133 | + * |
|
| 134 | + * @sine 1.9.0 |
|
| 135 | + * |
|
| 136 | + * |
|
| 137 | + * @return false|string |
|
| 138 | + */ |
|
| 139 | + public function get_course_post_type_archive_slug(){ |
|
| 140 | 140 | |
| 141 | - $settings_course_page = get_post( Sensei()->settings->get( 'course_page' ) ); |
|
| 141 | + $settings_course_page = get_post( Sensei()->settings->get( 'course_page' ) ); |
|
| 142 | 142 | |
| 143 | - // for a valid post that doesn't have any of the old short codes set the archive the same |
|
| 144 | - // as the page URI |
|
| 145 | - if( is_a( $settings_course_page, 'WP_Post') && ! $this->has_old_shortcodes( $settings_course_page->post_content ) ){ |
|
| 143 | + // for a valid post that doesn't have any of the old short codes set the archive the same |
|
| 144 | + // as the page URI |
|
| 145 | + if( is_a( $settings_course_page, 'WP_Post') && ! $this->has_old_shortcodes( $settings_course_page->post_content ) ){ |
|
| 146 | 146 | |
| 147 | - return get_page_uri( $settings_course_page->ID ); |
|
| 147 | + return get_page_uri( $settings_course_page->ID ); |
|
| 148 | 148 | |
| 149 | - }else{ |
|
| 149 | + }else{ |
|
| 150 | 150 | |
| 151 | - return 'courses'; |
|
| 151 | + return 'courses'; |
|
| 152 | 152 | |
| 153 | - } |
|
| 153 | + } |
|
| 154 | 154 | |
| 155 | - }// end course_post_type_determine_archive |
|
| 155 | + }// end course_post_type_determine_archive |
|
| 156 | 156 | |
| 157 | - /** |
|
| 158 | - * Check if given content has any of these old shortcodes: |
|
| 159 | - * [newcourses][featuredcourses][freecourses][paidcourses] |
|
| 160 | - * |
|
| 161 | - * @since 1.9.0 |
|
| 162 | - */ |
|
| 163 | - public function has_old_shortcodes( $content ){ |
|
| 157 | + /** |
|
| 158 | + * Check if given content has any of these old shortcodes: |
|
| 159 | + * [newcourses][featuredcourses][freecourses][paidcourses] |
|
| 160 | + * |
|
| 161 | + * @since 1.9.0 |
|
| 162 | + */ |
|
| 163 | + public function has_old_shortcodes( $content ){ |
|
| 164 | 164 | |
| 165 | - return ( has_shortcode( $content, 'newcourses') |
|
| 166 | - || has_shortcode( $content, 'featuredcourses') |
|
| 167 | - || has_shortcode( $content, 'freecourses') |
|
| 168 | - || has_shortcode( $content, 'paidcourses') ); |
|
| 165 | + return ( has_shortcode( $content, 'newcourses') |
|
| 166 | + || has_shortcode( $content, 'featuredcourses') |
|
| 167 | + || has_shortcode( $content, 'freecourses') |
|
| 168 | + || has_shortcode( $content, 'paidcourses') ); |
|
| 169 | 169 | |
| 170 | - }// end has old shortcodes |
|
| 170 | + }// end has old shortcodes |
|
| 171 | 171 | |
| 172 | 172 | |
| 173 | 173 | /** |
@@ -189,32 +189,32 @@ discard block |
||
| 189 | 189 | } // End If Statement |
| 190 | 190 | |
| 191 | 191 | $args = array( |
| 192 | - 'labels' => $this->create_post_type_labels( 'lesson', $this->labels['lesson']['singular'], $this->labels['lesson']['plural'], $this->labels['lesson']['menu'] ), |
|
| 193 | - 'public' => true, |
|
| 194 | - 'publicly_queryable' => true, |
|
| 195 | - 'show_ui' => true, |
|
| 196 | - 'show_in_menu' => true, |
|
| 197 | - 'query_var' => true, |
|
| 198 | - 'rewrite' => array( |
|
| 199 | - 'slug' => esc_attr( apply_filters( 'sensei_lesson_slug', _x( 'lesson', 'post type single slug', 'woothemes-sensei' ) ) ) , |
|
| 200 | - 'with_front' => true, |
|
| 201 | - 'feeds' => true, |
|
| 202 | - 'pages' => true |
|
| 203 | - ), |
|
| 204 | - 'map_meta_cap' => true, |
|
| 205 | - 'capability_type' => 'lesson', |
|
| 206 | - 'has_archive' => true, |
|
| 207 | - 'hierarchical' => false, |
|
| 208 | - 'menu_position' => 52, |
|
| 209 | - 'supports' => $supports_array |
|
| 192 | + 'labels' => $this->create_post_type_labels( 'lesson', $this->labels['lesson']['singular'], $this->labels['lesson']['plural'], $this->labels['lesson']['menu'] ), |
|
| 193 | + 'public' => true, |
|
| 194 | + 'publicly_queryable' => true, |
|
| 195 | + 'show_ui' => true, |
|
| 196 | + 'show_in_menu' => true, |
|
| 197 | + 'query_var' => true, |
|
| 198 | + 'rewrite' => array( |
|
| 199 | + 'slug' => esc_attr( apply_filters( 'sensei_lesson_slug', _x( 'lesson', 'post type single slug', 'woothemes-sensei' ) ) ) , |
|
| 200 | + 'with_front' => true, |
|
| 201 | + 'feeds' => true, |
|
| 202 | + 'pages' => true |
|
| 203 | + ), |
|
| 204 | + 'map_meta_cap' => true, |
|
| 205 | + 'capability_type' => 'lesson', |
|
| 206 | + 'has_archive' => true, |
|
| 207 | + 'hierarchical' => false, |
|
| 208 | + 'menu_position' => 52, |
|
| 209 | + 'supports' => $supports_array |
|
| 210 | 210 | ); |
| 211 | 211 | |
| 212 | - /** |
|
| 213 | - * Filter the arguments passed in when registering the Sensei Lesson post type. |
|
| 214 | - * |
|
| 215 | - * @since 1.9.0 |
|
| 216 | - * @param array $args |
|
| 217 | - */ |
|
| 212 | + /** |
|
| 213 | + * Filter the arguments passed in when registering the Sensei Lesson post type. |
|
| 214 | + * |
|
| 215 | + * @since 1.9.0 |
|
| 216 | + * @param array $args |
|
| 217 | + */ |
|
| 218 | 218 | register_post_type( 'lesson', apply_filters( 'sensei_register_post_type_lesson', $args ) ); |
| 219 | 219 | |
| 220 | 220 | } // End setup_lesson_post_type() |
@@ -222,46 +222,46 @@ discard block |
||
| 222 | 222 | /** |
| 223 | 223 | * Setup the "quiz" post type, it's admin menu item and the appropriate labels and permissions. |
| 224 | 224 | * @since 1.0.0 |
| 225 | - * @uses Sensei() |
|
| 225 | + * @uses Sensei() |
|
| 226 | 226 | * @return void |
| 227 | 227 | */ |
| 228 | 228 | public function setup_quiz_post_type () { |
| 229 | 229 | |
| 230 | 230 | |
| 231 | 231 | $args = array( |
| 232 | - 'labels' => $this->create_post_type_labels( |
|
| 233 | - 'quiz', |
|
| 234 | - $this->labels['quiz']['singular'], |
|
| 235 | - $this->labels['quiz']['plural'], |
|
| 236 | - $this->labels['quiz']['menu'] |
|
| 237 | - ), |
|
| 238 | - 'public' => true, |
|
| 239 | - 'publicly_queryable' => true, |
|
| 240 | - 'show_ui' => true, |
|
| 241 | - 'show_in_menu' => false, |
|
| 242 | - 'show_in_nav_menus' => false, |
|
| 243 | - 'query_var' => true, |
|
| 244 | - 'exclude_from_search' => true, |
|
| 245 | - 'rewrite' => array( |
|
| 246 | - 'slug' => esc_attr( apply_filters( 'sensei_quiz_slug', _x( 'quiz', 'post type single slug', 'woothemes-sensei' ) ) ) , |
|
| 247 | - 'with_front' => true, |
|
| 248 | - 'feeds' => true, |
|
| 249 | - 'pages' => true |
|
| 250 | - ), |
|
| 251 | - 'map_meta_cap' => true, |
|
| 252 | - 'capability_type' => 'quiz', |
|
| 253 | - 'has_archive' => false, |
|
| 254 | - 'hierarchical' => false, |
|
| 255 | - 'menu_position' => 20, // Below "Pages" |
|
| 256 | - 'supports' => array( '' ) |
|
| 232 | + 'labels' => $this->create_post_type_labels( |
|
| 233 | + 'quiz', |
|
| 234 | + $this->labels['quiz']['singular'], |
|
| 235 | + $this->labels['quiz']['plural'], |
|
| 236 | + $this->labels['quiz']['menu'] |
|
| 237 | + ), |
|
| 238 | + 'public' => true, |
|
| 239 | + 'publicly_queryable' => true, |
|
| 240 | + 'show_ui' => true, |
|
| 241 | + 'show_in_menu' => false, |
|
| 242 | + 'show_in_nav_menus' => false, |
|
| 243 | + 'query_var' => true, |
|
| 244 | + 'exclude_from_search' => true, |
|
| 245 | + 'rewrite' => array( |
|
| 246 | + 'slug' => esc_attr( apply_filters( 'sensei_quiz_slug', _x( 'quiz', 'post type single slug', 'woothemes-sensei' ) ) ) , |
|
| 247 | + 'with_front' => true, |
|
| 248 | + 'feeds' => true, |
|
| 249 | + 'pages' => true |
|
| 250 | + ), |
|
| 251 | + 'map_meta_cap' => true, |
|
| 252 | + 'capability_type' => 'quiz', |
|
| 253 | + 'has_archive' => false, |
|
| 254 | + 'hierarchical' => false, |
|
| 255 | + 'menu_position' => 20, // Below "Pages" |
|
| 256 | + 'supports' => array( '' ) |
|
| 257 | 257 | ); |
| 258 | 258 | |
| 259 | - /** |
|
| 260 | - * Filter the arguments passed in when registering the Sensei Quiz post type. |
|
| 261 | - * |
|
| 262 | - * @since 1.9.0 |
|
| 263 | - * @param array $args |
|
| 264 | - */ |
|
| 259 | + /** |
|
| 260 | + * Filter the arguments passed in when registering the Sensei Quiz post type. |
|
| 261 | + * |
|
| 262 | + * @since 1.9.0 |
|
| 263 | + * @param array $args |
|
| 264 | + */ |
|
| 265 | 265 | register_post_type( 'quiz', apply_filters( 'sensei_register_post_type_quiz', $args ) ); |
| 266 | 266 | |
| 267 | 267 | } // End setup_quiz_post_type() |
@@ -275,34 +275,34 @@ discard block |
||
| 275 | 275 | public function setup_question_post_type () { |
| 276 | 276 | |
| 277 | 277 | $args = array( |
| 278 | - 'labels' => $this->create_post_type_labels( 'question', $this->labels['question']['singular'], $this->labels['question']['plural'], $this->labels['question']['menu'] ), |
|
| 279 | - 'public' => false, |
|
| 280 | - 'publicly_queryable' => true, |
|
| 281 | - 'show_ui' => true, |
|
| 282 | - 'show_in_menu' => true, |
|
| 283 | - 'show_in_nav_menus' => false, |
|
| 284 | - 'query_var' => true, |
|
| 285 | - 'exclude_from_search' => true, |
|
| 286 | - 'rewrite' => array( |
|
| 287 | - 'slug' => esc_attr( apply_filters( 'sensei_question_slug', _x( 'question', 'post type single slug', 'woothemes-sensei' ) ) ) , |
|
| 288 | - 'with_front' => true, |
|
| 289 | - 'feeds' => true, |
|
| 290 | - 'pages' => true |
|
| 291 | - ), |
|
| 292 | - 'map_meta_cap' => true, |
|
| 293 | - 'capability_type' => 'question', |
|
| 294 | - 'has_archive' => true, |
|
| 295 | - 'hierarchical' => false, |
|
| 296 | - 'menu_position' => 51, |
|
| 297 | - 'supports' => array( 'title' ) |
|
| 278 | + 'labels' => $this->create_post_type_labels( 'question', $this->labels['question']['singular'], $this->labels['question']['plural'], $this->labels['question']['menu'] ), |
|
| 279 | + 'public' => false, |
|
| 280 | + 'publicly_queryable' => true, |
|
| 281 | + 'show_ui' => true, |
|
| 282 | + 'show_in_menu' => true, |
|
| 283 | + 'show_in_nav_menus' => false, |
|
| 284 | + 'query_var' => true, |
|
| 285 | + 'exclude_from_search' => true, |
|
| 286 | + 'rewrite' => array( |
|
| 287 | + 'slug' => esc_attr( apply_filters( 'sensei_question_slug', _x( 'question', 'post type single slug', 'woothemes-sensei' ) ) ) , |
|
| 288 | + 'with_front' => true, |
|
| 289 | + 'feeds' => true, |
|
| 290 | + 'pages' => true |
|
| 291 | + ), |
|
| 292 | + 'map_meta_cap' => true, |
|
| 293 | + 'capability_type' => 'question', |
|
| 294 | + 'has_archive' => true, |
|
| 295 | + 'hierarchical' => false, |
|
| 296 | + 'menu_position' => 51, |
|
| 297 | + 'supports' => array( 'title' ) |
|
| 298 | 298 | ); |
| 299 | 299 | |
| 300 | - /** |
|
| 301 | - * Filter the arguments passed in when registering the Sensei Question post type. |
|
| 302 | - * |
|
| 303 | - * @since 1.9.0 |
|
| 304 | - * @param array $args |
|
| 305 | - */ |
|
| 300 | + /** |
|
| 301 | + * Filter the arguments passed in when registering the Sensei Question post type. |
|
| 302 | + * |
|
| 303 | + * @since 1.9.0 |
|
| 304 | + * @param array $args |
|
| 305 | + */ |
|
| 306 | 306 | register_post_type( 'question', apply_filters('sensei_register_post_type_question', $args ) ); |
| 307 | 307 | |
| 308 | 308 | } // End setup_question_post_type() |
@@ -315,26 +315,26 @@ discard block |
||
| 315 | 315 | public function setup_multiple_question_post_type () { |
| 316 | 316 | |
| 317 | 317 | $args = array( |
| 318 | - 'labels' => $this->create_post_type_labels( 'multiple_question', $this->labels['multiple_question']['singular'], $this->labels['multiple_question']['plural'], $this->labels['multiple_question']['menu'] ), |
|
| 319 | - 'public' => false, |
|
| 320 | - 'publicly_queryable' => false, |
|
| 321 | - 'show_ui' => false, |
|
| 322 | - 'show_in_menu' => false, |
|
| 323 | - 'show_in_nav_menus' => false, |
|
| 324 | - 'query_var' => false, |
|
| 325 | - 'exclude_from_search' => true, |
|
| 326 | - 'rewrite' => array( |
|
| 327 | - 'slug' => esc_attr( apply_filters( 'sensei_multiple_question_slug', _x( 'multiple_question', 'post type single slug', 'woothemes-sensei' ) ) ) , |
|
| 328 | - 'with_front' => false, |
|
| 329 | - 'feeds' => false, |
|
| 330 | - 'pages' => false |
|
| 331 | - ), |
|
| 332 | - 'map_meta_cap' => true, |
|
| 333 | - 'capability_type' => 'question', |
|
| 334 | - 'has_archive' => false, |
|
| 335 | - 'hierarchical' => false, |
|
| 336 | - 'menu_position' => 51, |
|
| 337 | - 'supports' => array( 'title', 'custom-fields' ) |
|
| 318 | + 'labels' => $this->create_post_type_labels( 'multiple_question', $this->labels['multiple_question']['singular'], $this->labels['multiple_question']['plural'], $this->labels['multiple_question']['menu'] ), |
|
| 319 | + 'public' => false, |
|
| 320 | + 'publicly_queryable' => false, |
|
| 321 | + 'show_ui' => false, |
|
| 322 | + 'show_in_menu' => false, |
|
| 323 | + 'show_in_nav_menus' => false, |
|
| 324 | + 'query_var' => false, |
|
| 325 | + 'exclude_from_search' => true, |
|
| 326 | + 'rewrite' => array( |
|
| 327 | + 'slug' => esc_attr( apply_filters( 'sensei_multiple_question_slug', _x( 'multiple_question', 'post type single slug', 'woothemes-sensei' ) ) ) , |
|
| 328 | + 'with_front' => false, |
|
| 329 | + 'feeds' => false, |
|
| 330 | + 'pages' => false |
|
| 331 | + ), |
|
| 332 | + 'map_meta_cap' => true, |
|
| 333 | + 'capability_type' => 'question', |
|
| 334 | + 'has_archive' => false, |
|
| 335 | + 'hierarchical' => false, |
|
| 336 | + 'menu_position' => 51, |
|
| 337 | + 'supports' => array( 'title', 'custom-fields' ) |
|
| 338 | 338 | ); |
| 339 | 339 | |
| 340 | 340 | register_post_type( 'multiple_question', $args ); |
@@ -351,34 +351,34 @@ discard block |
||
| 351 | 351 | if( ! isset( Sensei()->settings->settings['messages_disable'] ) || ! Sensei()->settings->settings['messages_disable'] ) { |
| 352 | 352 | |
| 353 | 353 | $args = array( |
| 354 | - 'labels' => $this->create_post_type_labels( 'sensei_message', $this->labels['sensei_message']['singular'], $this->labels['sensei_message']['plural'], $this->labels['sensei_message']['menu'] ), |
|
| 355 | - 'public' => true, |
|
| 356 | - 'publicly_queryable' => true, |
|
| 357 | - 'show_ui' => true, |
|
| 358 | - 'show_in_menu' => 'sensei', |
|
| 359 | - 'show_in_nav_menus' => true, |
|
| 360 | - 'query_var' => true, |
|
| 361 | - 'exclude_from_search' => true, |
|
| 362 | - 'rewrite' => array( |
|
| 363 | - 'slug' => esc_attr( apply_filters( 'sensei_messages_slug', _x( 'messages', 'post type single slug', 'woothemes-sensei' ) ) ) , |
|
| 364 | - 'with_front' => false, |
|
| 365 | - 'feeds' => false, |
|
| 366 | - 'pages' => true |
|
| 367 | - ), |
|
| 368 | - 'map_meta_cap' => true, |
|
| 369 | - 'capability_type' => 'question', |
|
| 370 | - 'has_archive' => true, |
|
| 371 | - 'hierarchical' => false, |
|
| 372 | - 'menu_position' => 50, |
|
| 373 | - 'supports' => array( 'title', 'editor', 'comments' ), |
|
| 354 | + 'labels' => $this->create_post_type_labels( 'sensei_message', $this->labels['sensei_message']['singular'], $this->labels['sensei_message']['plural'], $this->labels['sensei_message']['menu'] ), |
|
| 355 | + 'public' => true, |
|
| 356 | + 'publicly_queryable' => true, |
|
| 357 | + 'show_ui' => true, |
|
| 358 | + 'show_in_menu' => 'sensei', |
|
| 359 | + 'show_in_nav_menus' => true, |
|
| 360 | + 'query_var' => true, |
|
| 361 | + 'exclude_from_search' => true, |
|
| 362 | + 'rewrite' => array( |
|
| 363 | + 'slug' => esc_attr( apply_filters( 'sensei_messages_slug', _x( 'messages', 'post type single slug', 'woothemes-sensei' ) ) ) , |
|
| 364 | + 'with_front' => false, |
|
| 365 | + 'feeds' => false, |
|
| 366 | + 'pages' => true |
|
| 367 | + ), |
|
| 368 | + 'map_meta_cap' => true, |
|
| 369 | + 'capability_type' => 'question', |
|
| 370 | + 'has_archive' => true, |
|
| 371 | + 'hierarchical' => false, |
|
| 372 | + 'menu_position' => 50, |
|
| 373 | + 'supports' => array( 'title', 'editor', 'comments' ), |
|
| 374 | 374 | ); |
| 375 | 375 | |
| 376 | - /** |
|
| 377 | - * Filter the arguments passed in when registering the Sensei sensei_message post type. |
|
| 378 | - * |
|
| 379 | - * @since 1.9.0 |
|
| 380 | - * @param array $args |
|
| 381 | - */ |
|
| 376 | + /** |
|
| 377 | + * Filter the arguments passed in when registering the Sensei sensei_message post type. |
|
| 378 | + * |
|
| 379 | + * @since 1.9.0 |
|
| 380 | + * @param array $args |
|
| 381 | + */ |
|
| 382 | 382 | register_post_type( 'sensei_message', apply_filters('sensei_register_post_type_sensei_message', $args ) ); |
| 383 | 383 | } |
| 384 | 384 | } // End setup_sensei_message_post_type() |
@@ -411,11 +411,11 @@ discard block |
||
| 411 | 411 | 'show_ui' => true, |
| 412 | 412 | 'query_var' => true, |
| 413 | 413 | 'show_in_nav_menus' => true, |
| 414 | - 'capabilities' => array( |
|
| 415 | - 'manage_terms' => 'manage_categories', |
|
| 416 | - 'edit_terms' => 'edit_courses', |
|
| 417 | - 'delete_terms' => 'manage_categories', |
|
| 418 | - 'assign_terms' => 'edit_courses',), |
|
| 414 | + 'capabilities' => array( |
|
| 415 | + 'manage_terms' => 'manage_categories', |
|
| 416 | + 'edit_terms' => 'edit_courses', |
|
| 417 | + 'delete_terms' => 'manage_categories', |
|
| 418 | + 'assign_terms' => 'edit_courses',), |
|
| 419 | 419 | 'rewrite' => array( 'slug' => esc_attr( apply_filters( 'sensei_course_category_slug', _x( 'course-category', 'taxonomy archive slug', 'woothemes-sensei' ) ) ) ) |
| 420 | 420 | ); |
| 421 | 421 | |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | 'show_ui' => true, /* TO DO - future releases */ |
| 452 | 452 | 'query_var' => true, |
| 453 | 453 | 'show_in_nav_menus' => false, |
| 454 | - 'public' => false, |
|
| 454 | + 'public' => false, |
|
| 455 | 455 | 'rewrite' => array( 'slug' => esc_attr( apply_filters( 'sensei_quiz_type_slug', _x( 'quiz-type', 'taxonomy archive slug', 'woothemes-sensei' ) ) ) ) |
| 456 | 456 | ); |
| 457 | 457 | |
@@ -523,11 +523,11 @@ discard block |
||
| 523 | 523 | 'query_var' => false, |
| 524 | 524 | 'show_in_nav_menus' => false, |
| 525 | 525 | 'show_admin_column' => true, |
| 526 | - 'capabilities' => array( |
|
| 527 | - 'manage_terms' => 'manage_categories', |
|
| 528 | - 'edit_terms' => 'edit_questions', |
|
| 529 | - 'delete_terms' => 'manage_categories', |
|
| 530 | - 'assign_terms' => 'edit_questions',), |
|
| 526 | + 'capabilities' => array( |
|
| 527 | + 'manage_terms' => 'manage_categories', |
|
| 528 | + 'edit_terms' => 'edit_questions', |
|
| 529 | + 'delete_terms' => 'manage_categories', |
|
| 530 | + 'assign_terms' => 'edit_questions',), |
|
| 531 | 531 | 'rewrite' => array( 'slug' => esc_attr( apply_filters( 'sensei_question_category_slug', _x( 'question-category', 'taxonomy archive slug', 'woothemes-sensei' ) ) ) ) |
| 532 | 532 | ); |
| 533 | 533 | |
@@ -561,11 +561,11 @@ discard block |
||
| 561 | 561 | 'show_ui' => true, |
| 562 | 562 | 'query_var' => true, |
| 563 | 563 | 'show_in_nav_menus' => true, |
| 564 | - 'capabilities' => array( |
|
| 565 | - 'manage_terms' => 'manage_categories', |
|
| 566 | - 'edit_terms' => 'edit_lessons', |
|
| 567 | - 'delete_terms' => 'manage_categories', |
|
| 568 | - 'assign_terms' => 'edit_lessons',), |
|
| 564 | + 'capabilities' => array( |
|
| 565 | + 'manage_terms' => 'manage_categories', |
|
| 566 | + 'edit_terms' => 'edit_lessons', |
|
| 567 | + 'delete_terms' => 'manage_categories', |
|
| 568 | + 'assign_terms' => 'edit_lessons',), |
|
| 569 | 569 | 'rewrite' => array( 'slug' => esc_attr( apply_filters( 'sensei_lesson_tag_slug', _x( 'lesson-tag', 'taxonomy archive slug', 'woothemes-sensei' ) ) ) ) |
| 570 | 570 | ); |
| 571 | 571 | |
@@ -600,19 +600,19 @@ discard block |
||
| 600 | 600 | */ |
| 601 | 601 | private function create_post_type_labels ( $token, $singular, $plural, $menu ) { |
| 602 | 602 | $labels = array( |
| 603 | - 'name' => sprintf( _x( '%s', 'post type general name', 'woothemes-sensei' ), $plural ), |
|
| 604 | - 'singular_name' => sprintf( _x( '%s', 'post type singular name', 'woothemes-sensei' ), $singular ), |
|
| 605 | - 'add_new' => __( 'Add New', 'woothemes-sensei' ), |
|
| 606 | - 'add_new_item' => sprintf( __( 'Add New %s', 'woothemes-sensei' ), $singular ), |
|
| 607 | - 'edit_item' => sprintf( __( 'Edit %s', 'woothemes-sensei' ), $singular ), |
|
| 608 | - 'new_item' => sprintf( __( 'New %s', 'woothemes-sensei' ), $singular ), |
|
| 609 | - 'all_items' => sprintf( __( 'All %s', 'woothemes-sensei' ), $plural ), |
|
| 610 | - 'view_item' => sprintf( __( 'View %s', 'woothemes-sensei' ), $singular ), |
|
| 611 | - 'search_items' => sprintf( __( 'Search %s', 'woothemes-sensei' ), $plural ), |
|
| 612 | - 'not_found' => sprintf( __( 'No %s found', 'woothemes-sensei' ), mb_strtolower( $plural, 'UTF-8') ), |
|
| 613 | - 'not_found_in_trash' => sprintf( __( 'No %s found in Trash', 'woothemes-sensei' ), mb_strtolower( $plural, 'UTF-8') ), |
|
| 614 | - 'parent_item_colon' => '', |
|
| 615 | - 'menu_name' => sprintf( __( '%s', 'woothemes-sensei' ), $menu ) |
|
| 603 | + 'name' => sprintf( _x( '%s', 'post type general name', 'woothemes-sensei' ), $plural ), |
|
| 604 | + 'singular_name' => sprintf( _x( '%s', 'post type singular name', 'woothemes-sensei' ), $singular ), |
|
| 605 | + 'add_new' => __( 'Add New', 'woothemes-sensei' ), |
|
| 606 | + 'add_new_item' => sprintf( __( 'Add New %s', 'woothemes-sensei' ), $singular ), |
|
| 607 | + 'edit_item' => sprintf( __( 'Edit %s', 'woothemes-sensei' ), $singular ), |
|
| 608 | + 'new_item' => sprintf( __( 'New %s', 'woothemes-sensei' ), $singular ), |
|
| 609 | + 'all_items' => sprintf( __( 'All %s', 'woothemes-sensei' ), $plural ), |
|
| 610 | + 'view_item' => sprintf( __( 'View %s', 'woothemes-sensei' ), $singular ), |
|
| 611 | + 'search_items' => sprintf( __( 'Search %s', 'woothemes-sensei' ), $plural ), |
|
| 612 | + 'not_found' => sprintf( __( 'No %s found', 'woothemes-sensei' ), mb_strtolower( $plural, 'UTF-8') ), |
|
| 613 | + 'not_found_in_trash' => sprintf( __( 'No %s found in Trash', 'woothemes-sensei' ), mb_strtolower( $plural, 'UTF-8') ), |
|
| 614 | + 'parent_item_colon' => '', |
|
| 615 | + 'menu_name' => sprintf( __( '%s', 'woothemes-sensei' ), $menu ) |
|
| 616 | 616 | ); |
| 617 | 617 | |
| 618 | 618 | return $labels; |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 2 | +if ( ! defined('ABSPATH')) exit; // Exit if accessed directly |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Sensei Post Types Class |
@@ -22,42 +22,42 @@ discard block |
||
| 22 | 22 | * @since 1.0.0 |
| 23 | 23 | * @return void |
| 24 | 24 | */ |
| 25 | - public function __construct () { |
|
| 25 | + public function __construct() { |
|
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | // Setup Post Types |
| 29 | 29 | $this->labels = array(); |
| 30 | 30 | $this->setup_post_type_labels_base(); |
| 31 | - add_action( 'init', array( $this, 'setup_course_post_type' ), 100 ); |
|
| 32 | - add_action( 'init', array( $this, 'setup_lesson_post_type' ), 100 ); |
|
| 33 | - add_action( 'init', array( $this, 'setup_quiz_post_type' ), 100 ); |
|
| 34 | - add_action( 'init', array( $this, 'setup_question_post_type' ), 100 ); |
|
| 35 | - add_action( 'init', array( $this, 'setup_multiple_question_post_type' ), 100 ); |
|
| 36 | - add_action( 'init', array( $this, 'setup_sensei_message_post_type' ), 100 ); |
|
| 31 | + add_action('init', array($this, 'setup_course_post_type'), 100); |
|
| 32 | + add_action('init', array($this, 'setup_lesson_post_type'), 100); |
|
| 33 | + add_action('init', array($this, 'setup_quiz_post_type'), 100); |
|
| 34 | + add_action('init', array($this, 'setup_question_post_type'), 100); |
|
| 35 | + add_action('init', array($this, 'setup_multiple_question_post_type'), 100); |
|
| 36 | + add_action('init', array($this, 'setup_sensei_message_post_type'), 100); |
|
| 37 | 37 | |
| 38 | 38 | // Setup Taxonomies |
| 39 | - add_action( 'init', array( $this, 'setup_course_category_taxonomy' ), 100 ); |
|
| 40 | - add_action( 'init', array( $this, 'setup_quiz_type_taxonomy' ), 100 ); |
|
| 41 | - add_action( 'init', array( $this, 'setup_question_type_taxonomy' ), 100 ); |
|
| 42 | - add_action( 'init', array( $this, 'setup_question_category_taxonomy' ), 100 ); |
|
| 43 | - add_action( 'init', array( $this, 'setup_lesson_tag_taxonomy' ), 100 ); |
|
| 39 | + add_action('init', array($this, 'setup_course_category_taxonomy'), 100); |
|
| 40 | + add_action('init', array($this, 'setup_quiz_type_taxonomy'), 100); |
|
| 41 | + add_action('init', array($this, 'setup_question_type_taxonomy'), 100); |
|
| 42 | + add_action('init', array($this, 'setup_question_category_taxonomy'), 100); |
|
| 43 | + add_action('init', array($this, 'setup_lesson_tag_taxonomy'), 100); |
|
| 44 | 44 | |
| 45 | 45 | // Load Post Type Objects |
| 46 | - $default_post_types = array( 'course' => 'Course', 'lesson' => 'Lesson', 'quiz' => 'Quiz', 'question' => 'Question', 'messages' => 'Messages' ) ; |
|
| 47 | - $this->load_posttype_objects( $default_post_types ); |
|
| 46 | + $default_post_types = array('course' => 'Course', 'lesson' => 'Lesson', 'quiz' => 'Quiz', 'question' => 'Question', 'messages' => 'Messages'); |
|
| 47 | + $this->load_posttype_objects($default_post_types); |
|
| 48 | 48 | |
| 49 | 49 | // Admin functions |
| 50 | - if ( is_admin() ) { |
|
| 51 | - $this->set_role_cap_defaults( $default_post_types ); |
|
| 50 | + if (is_admin()) { |
|
| 51 | + $this->set_role_cap_defaults($default_post_types); |
|
| 52 | 52 | global $pagenow; |
| 53 | - if ( ( $pagenow == 'post.php' || $pagenow == 'post-new.php' ) ) { |
|
| 54 | - add_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 10 ); |
|
| 55 | - add_filter( 'post_updated_messages', array( $this, 'setup_post_type_messages' ) ); |
|
| 53 | + if (($pagenow == 'post.php' || $pagenow == 'post-new.php')) { |
|
| 54 | + add_filter('enter_title_here', array($this, 'enter_title_here'), 10); |
|
| 55 | + add_filter('post_updated_messages', array($this, 'setup_post_type_messages')); |
|
| 56 | 56 | } // End If Statement |
| 57 | 57 | } // End If Statement |
| 58 | 58 | |
| 59 | 59 | // Add 'Edit Quiz' link to admin bar |
| 60 | - add_action( 'admin_bar_menu', array( $this, 'quiz_admin_bar_menu' ), 81 ); |
|
| 60 | + add_action('admin_bar_menu', array($this, 'quiz_admin_bar_menu'), 81); |
|
| 61 | 61 | |
| 62 | 62 | } // End __construct() |
| 63 | 63 | |
@@ -68,12 +68,12 @@ discard block |
||
| 68 | 68 | * @param array $posttypes (default: array()) |
| 69 | 69 | * @return void |
| 70 | 70 | */ |
| 71 | - public function load_posttype_objects( $posttypes = array() ) { |
|
| 71 | + public function load_posttype_objects($posttypes = array()) { |
|
| 72 | 72 | |
| 73 | - foreach ( $posttypes as $posttype_token => $posttype_name ) { |
|
| 73 | + foreach ($posttypes as $posttype_token => $posttype_name) { |
|
| 74 | 74 | |
| 75 | 75 | // Load the files |
| 76 | - $class_name = 'WooThemes_Sensei_' . $posttype_name; |
|
| 76 | + $class_name = 'WooThemes_Sensei_'.$posttype_name; |
|
| 77 | 77 | $this->$posttype_token = new $class_name(); |
| 78 | 78 | $this->$posttype_token->token = $posttype_token; |
| 79 | 79 | |
@@ -87,10 +87,10 @@ discard block |
||
| 87 | 87 | * @uses Sensei() |
| 88 | 88 | * @return void |
| 89 | 89 | */ |
| 90 | - public function setup_course_post_type () { |
|
| 90 | + public function setup_course_post_type() { |
|
| 91 | 91 | |
| 92 | 92 | $args = array( |
| 93 | - 'labels' => $this->create_post_type_labels( 'course', $this->labels['course']['singular'], $this->labels['course']['plural'], $this->labels['course']['menu'] ), |
|
| 93 | + 'labels' => $this->create_post_type_labels('course', $this->labels['course']['singular'], $this->labels['course']['plural'], $this->labels['course']['menu']), |
|
| 94 | 94 | 'public' => true, |
| 95 | 95 | 'publicly_queryable' => true, |
| 96 | 96 | 'show_ui' => true, |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | 'show_in_admin_bar' => true, |
| 99 | 99 | 'query_var' => true, |
| 100 | 100 | 'rewrite' => array( |
| 101 | - 'slug' => esc_attr( apply_filters( 'sensei_course_slug', _x( 'course', 'post type single url base', 'woothemes-sensei' ) ) ) , |
|
| 101 | + 'slug' => esc_attr(apply_filters('sensei_course_slug', _x('course', 'post type single url base', 'woothemes-sensei'))), |
|
| 102 | 102 | 'with_front' => true, |
| 103 | 103 | 'feeds' => true, |
| 104 | 104 | 'pages' => true |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | 'has_archive' => $this->get_course_post_type_archive_slug(), |
| 109 | 109 | 'hierarchical' => false, |
| 110 | 110 | 'menu_position' => 51, |
| 111 | - 'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail' ) |
|
| 111 | + 'supports' => array('title', 'editor', 'excerpt', 'thumbnail') |
|
| 112 | 112 | ); |
| 113 | 113 | |
| 114 | 114 | /** |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * @since 1.9.0 |
| 118 | 118 | * @param array $args |
| 119 | 119 | */ |
| 120 | - register_post_type( 'course', apply_filters( 'sensei_register_post_type_course', $args ) ); |
|
| 120 | + register_post_type('course', apply_filters('sensei_register_post_type_course', $args)); |
|
| 121 | 121 | |
| 122 | 122 | } // End setup_course_post_type() |
| 123 | 123 | |
@@ -136,17 +136,17 @@ discard block |
||
| 136 | 136 | * |
| 137 | 137 | * @return false|string |
| 138 | 138 | */ |
| 139 | - public function get_course_post_type_archive_slug(){ |
|
| 139 | + public function get_course_post_type_archive_slug() { |
|
| 140 | 140 | |
| 141 | - $settings_course_page = get_post( Sensei()->settings->get( 'course_page' ) ); |
|
| 141 | + $settings_course_page = get_post(Sensei()->settings->get('course_page')); |
|
| 142 | 142 | |
| 143 | 143 | // for a valid post that doesn't have any of the old short codes set the archive the same |
| 144 | 144 | // as the page URI |
| 145 | - if( is_a( $settings_course_page, 'WP_Post') && ! $this->has_old_shortcodes( $settings_course_page->post_content ) ){ |
|
| 145 | + if (is_a($settings_course_page, 'WP_Post') && ! $this->has_old_shortcodes($settings_course_page->post_content)) { |
|
| 146 | 146 | |
| 147 | - return get_page_uri( $settings_course_page->ID ); |
|
| 147 | + return get_page_uri($settings_course_page->ID); |
|
| 148 | 148 | |
| 149 | - }else{ |
|
| 149 | + } else { |
|
| 150 | 150 | |
| 151 | 151 | return 'courses'; |
| 152 | 152 | |
@@ -160,12 +160,12 @@ discard block |
||
| 160 | 160 | * |
| 161 | 161 | * @since 1.9.0 |
| 162 | 162 | */ |
| 163 | - public function has_old_shortcodes( $content ){ |
|
| 163 | + public function has_old_shortcodes($content) { |
|
| 164 | 164 | |
| 165 | - return ( has_shortcode( $content, 'newcourses') |
|
| 166 | - || has_shortcode( $content, 'featuredcourses') |
|
| 167 | - || has_shortcode( $content, 'freecourses') |
|
| 168 | - || has_shortcode( $content, 'paidcourses') ); |
|
| 165 | + return (has_shortcode($content, 'newcourses') |
|
| 166 | + || has_shortcode($content, 'featuredcourses') |
|
| 167 | + || has_shortcode($content, 'freecourses') |
|
| 168 | + || has_shortcode($content, 'paidcourses')); |
|
| 169 | 169 | |
| 170 | 170 | }// end has old shortcodes |
| 171 | 171 | |
@@ -176,27 +176,27 @@ discard block |
||
| 176 | 176 | * @uses Sensei() |
| 177 | 177 | * @return void |
| 178 | 178 | */ |
| 179 | - public function setup_lesson_post_type () { |
|
| 179 | + public function setup_lesson_post_type() { |
|
| 180 | 180 | |
| 181 | 181 | |
| 182 | - $supports_array = array( 'title', 'editor', 'excerpt', 'thumbnail', 'page-attributes' ); |
|
| 182 | + $supports_array = array('title', 'editor', 'excerpt', 'thumbnail', 'page-attributes'); |
|
| 183 | 183 | $allow_comments = false; |
| 184 | - if ( isset( Sensei()->settings->settings[ 'lesson_comments' ] ) ) { |
|
| 185 | - $allow_comments = Sensei()->settings->settings[ 'lesson_comments' ]; |
|
| 184 | + if (isset(Sensei()->settings->settings['lesson_comments'])) { |
|
| 185 | + $allow_comments = Sensei()->settings->settings['lesson_comments']; |
|
| 186 | 186 | } // End If Statement |
| 187 | - if ( $allow_comments ) { |
|
| 188 | - array_push( $supports_array, 'comments' ); |
|
| 187 | + if ($allow_comments) { |
|
| 188 | + array_push($supports_array, 'comments'); |
|
| 189 | 189 | } // End If Statement |
| 190 | 190 | |
| 191 | 191 | $args = array( |
| 192 | - 'labels' => $this->create_post_type_labels( 'lesson', $this->labels['lesson']['singular'], $this->labels['lesson']['plural'], $this->labels['lesson']['menu'] ), |
|
| 192 | + 'labels' => $this->create_post_type_labels('lesson', $this->labels['lesson']['singular'], $this->labels['lesson']['plural'], $this->labels['lesson']['menu']), |
|
| 193 | 193 | 'public' => true, |
| 194 | 194 | 'publicly_queryable' => true, |
| 195 | 195 | 'show_ui' => true, |
| 196 | 196 | 'show_in_menu' => true, |
| 197 | 197 | 'query_var' => true, |
| 198 | 198 | 'rewrite' => array( |
| 199 | - 'slug' => esc_attr( apply_filters( 'sensei_lesson_slug', _x( 'lesson', 'post type single slug', 'woothemes-sensei' ) ) ) , |
|
| 199 | + 'slug' => esc_attr(apply_filters('sensei_lesson_slug', _x('lesson', 'post type single slug', 'woothemes-sensei'))), |
|
| 200 | 200 | 'with_front' => true, |
| 201 | 201 | 'feeds' => true, |
| 202 | 202 | 'pages' => true |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | * @since 1.9.0 |
| 216 | 216 | * @param array $args |
| 217 | 217 | */ |
| 218 | - register_post_type( 'lesson', apply_filters( 'sensei_register_post_type_lesson', $args ) ); |
|
| 218 | + register_post_type('lesson', apply_filters('sensei_register_post_type_lesson', $args)); |
|
| 219 | 219 | |
| 220 | 220 | } // End setup_lesson_post_type() |
| 221 | 221 | |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | * @uses Sensei() |
| 226 | 226 | * @return void |
| 227 | 227 | */ |
| 228 | - public function setup_quiz_post_type () { |
|
| 228 | + public function setup_quiz_post_type() { |
|
| 229 | 229 | |
| 230 | 230 | |
| 231 | 231 | $args = array( |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | 'query_var' => true, |
| 244 | 244 | 'exclude_from_search' => true, |
| 245 | 245 | 'rewrite' => array( |
| 246 | - 'slug' => esc_attr( apply_filters( 'sensei_quiz_slug', _x( 'quiz', 'post type single slug', 'woothemes-sensei' ) ) ) , |
|
| 246 | + 'slug' => esc_attr(apply_filters('sensei_quiz_slug', _x('quiz', 'post type single slug', 'woothemes-sensei'))), |
|
| 247 | 247 | 'with_front' => true, |
| 248 | 248 | 'feeds' => true, |
| 249 | 249 | 'pages' => true |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | 'has_archive' => false, |
| 254 | 254 | 'hierarchical' => false, |
| 255 | 255 | 'menu_position' => 20, // Below "Pages" |
| 256 | - 'supports' => array( '' ) |
|
| 256 | + 'supports' => array('') |
|
| 257 | 257 | ); |
| 258 | 258 | |
| 259 | 259 | /** |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | * @since 1.9.0 |
| 263 | 263 | * @param array $args |
| 264 | 264 | */ |
| 265 | - register_post_type( 'quiz', apply_filters( 'sensei_register_post_type_quiz', $args ) ); |
|
| 265 | + register_post_type('quiz', apply_filters('sensei_register_post_type_quiz', $args)); |
|
| 266 | 266 | |
| 267 | 267 | } // End setup_quiz_post_type() |
| 268 | 268 | |
@@ -272,10 +272,10 @@ discard block |
||
| 272 | 272 | * @since 1.0.0 |
| 273 | 273 | * @return void |
| 274 | 274 | */ |
| 275 | - public function setup_question_post_type () { |
|
| 275 | + public function setup_question_post_type() { |
|
| 276 | 276 | |
| 277 | 277 | $args = array( |
| 278 | - 'labels' => $this->create_post_type_labels( 'question', $this->labels['question']['singular'], $this->labels['question']['plural'], $this->labels['question']['menu'] ), |
|
| 278 | + 'labels' => $this->create_post_type_labels('question', $this->labels['question']['singular'], $this->labels['question']['plural'], $this->labels['question']['menu']), |
|
| 279 | 279 | 'public' => false, |
| 280 | 280 | 'publicly_queryable' => true, |
| 281 | 281 | 'show_ui' => true, |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | 'query_var' => true, |
| 285 | 285 | 'exclude_from_search' => true, |
| 286 | 286 | 'rewrite' => array( |
| 287 | - 'slug' => esc_attr( apply_filters( 'sensei_question_slug', _x( 'question', 'post type single slug', 'woothemes-sensei' ) ) ) , |
|
| 287 | + 'slug' => esc_attr(apply_filters('sensei_question_slug', _x('question', 'post type single slug', 'woothemes-sensei'))), |
|
| 288 | 288 | 'with_front' => true, |
| 289 | 289 | 'feeds' => true, |
| 290 | 290 | 'pages' => true |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | 'has_archive' => true, |
| 295 | 295 | 'hierarchical' => false, |
| 296 | 296 | 'menu_position' => 51, |
| 297 | - 'supports' => array( 'title' ) |
|
| 297 | + 'supports' => array('title') |
|
| 298 | 298 | ); |
| 299 | 299 | |
| 300 | 300 | /** |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | * @since 1.9.0 |
| 304 | 304 | * @param array $args |
| 305 | 305 | */ |
| 306 | - register_post_type( 'question', apply_filters('sensei_register_post_type_question', $args ) ); |
|
| 306 | + register_post_type('question', apply_filters('sensei_register_post_type_question', $args)); |
|
| 307 | 307 | |
| 308 | 308 | } // End setup_question_post_type() |
| 309 | 309 | |
@@ -312,10 +312,10 @@ discard block |
||
| 312 | 312 | * @since 1.6.0 |
| 313 | 313 | * @return void |
| 314 | 314 | */ |
| 315 | - public function setup_multiple_question_post_type () { |
|
| 315 | + public function setup_multiple_question_post_type() { |
|
| 316 | 316 | |
| 317 | 317 | $args = array( |
| 318 | - 'labels' => $this->create_post_type_labels( 'multiple_question', $this->labels['multiple_question']['singular'], $this->labels['multiple_question']['plural'], $this->labels['multiple_question']['menu'] ), |
|
| 318 | + 'labels' => $this->create_post_type_labels('multiple_question', $this->labels['multiple_question']['singular'], $this->labels['multiple_question']['plural'], $this->labels['multiple_question']['menu']), |
|
| 319 | 319 | 'public' => false, |
| 320 | 320 | 'publicly_queryable' => false, |
| 321 | 321 | 'show_ui' => false, |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | 'query_var' => false, |
| 325 | 325 | 'exclude_from_search' => true, |
| 326 | 326 | 'rewrite' => array( |
| 327 | - 'slug' => esc_attr( apply_filters( 'sensei_multiple_question_slug', _x( 'multiple_question', 'post type single slug', 'woothemes-sensei' ) ) ) , |
|
| 327 | + 'slug' => esc_attr(apply_filters('sensei_multiple_question_slug', _x('multiple_question', 'post type single slug', 'woothemes-sensei'))), |
|
| 328 | 328 | 'with_front' => false, |
| 329 | 329 | 'feeds' => false, |
| 330 | 330 | 'pages' => false |
@@ -334,10 +334,10 @@ discard block |
||
| 334 | 334 | 'has_archive' => false, |
| 335 | 335 | 'hierarchical' => false, |
| 336 | 336 | 'menu_position' => 51, |
| 337 | - 'supports' => array( 'title', 'custom-fields' ) |
|
| 337 | + 'supports' => array('title', 'custom-fields') |
|
| 338 | 338 | ); |
| 339 | 339 | |
| 340 | - register_post_type( 'multiple_question', $args ); |
|
| 340 | + register_post_type('multiple_question', $args); |
|
| 341 | 341 | } // End setup_multiple_question_post_type() |
| 342 | 342 | |
| 343 | 343 | /** |
@@ -345,13 +345,13 @@ discard block |
||
| 345 | 345 | * @since 1.6.0 |
| 346 | 346 | * @return void |
| 347 | 347 | */ |
| 348 | - public function setup_sensei_message_post_type () { |
|
| 348 | + public function setup_sensei_message_post_type() { |
|
| 349 | 349 | |
| 350 | 350 | |
| 351 | - if( ! isset( Sensei()->settings->settings['messages_disable'] ) || ! Sensei()->settings->settings['messages_disable'] ) { |
|
| 351 | + if ( ! isset(Sensei()->settings->settings['messages_disable']) || ! Sensei()->settings->settings['messages_disable']) { |
|
| 352 | 352 | |
| 353 | 353 | $args = array( |
| 354 | - 'labels' => $this->create_post_type_labels( 'sensei_message', $this->labels['sensei_message']['singular'], $this->labels['sensei_message']['plural'], $this->labels['sensei_message']['menu'] ), |
|
| 354 | + 'labels' => $this->create_post_type_labels('sensei_message', $this->labels['sensei_message']['singular'], $this->labels['sensei_message']['plural'], $this->labels['sensei_message']['menu']), |
|
| 355 | 355 | 'public' => true, |
| 356 | 356 | 'publicly_queryable' => true, |
| 357 | 357 | 'show_ui' => true, |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | 'query_var' => true, |
| 361 | 361 | 'exclude_from_search' => true, |
| 362 | 362 | 'rewrite' => array( |
| 363 | - 'slug' => esc_attr( apply_filters( 'sensei_messages_slug', _x( 'messages', 'post type single slug', 'woothemes-sensei' ) ) ) , |
|
| 363 | + 'slug' => esc_attr(apply_filters('sensei_messages_slug', _x('messages', 'post type single slug', 'woothemes-sensei'))), |
|
| 364 | 364 | 'with_front' => false, |
| 365 | 365 | 'feeds' => false, |
| 366 | 366 | 'pages' => true |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | 'has_archive' => true, |
| 371 | 371 | 'hierarchical' => false, |
| 372 | 372 | 'menu_position' => 50, |
| 373 | - 'supports' => array( 'title', 'editor', 'comments' ), |
|
| 373 | + 'supports' => array('title', 'editor', 'comments'), |
|
| 374 | 374 | ); |
| 375 | 375 | |
| 376 | 376 | /** |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | * @since 1.9.0 |
| 380 | 380 | * @param array $args |
| 381 | 381 | */ |
| 382 | - register_post_type( 'sensei_message', apply_filters('sensei_register_post_type_sensei_message', $args ) ); |
|
| 382 | + register_post_type('sensei_message', apply_filters('sensei_register_post_type_sensei_message', $args)); |
|
| 383 | 383 | } |
| 384 | 384 | } // End setup_sensei_message_post_type() |
| 385 | 385 | |
@@ -388,20 +388,20 @@ discard block |
||
| 388 | 388 | * @since 1.1.0 |
| 389 | 389 | * @return void |
| 390 | 390 | */ |
| 391 | - public function setup_course_category_taxonomy () { |
|
| 391 | + public function setup_course_category_taxonomy() { |
|
| 392 | 392 | // "Course Categories" Custom Taxonomy |
| 393 | 393 | $labels = array( |
| 394 | - 'name' => _x( 'Course Categories', 'taxonomy general name', 'woothemes-sensei' ), |
|
| 395 | - 'singular_name' => _x( 'Course Category', 'taxonomy singular name', 'woothemes-sensei' ), |
|
| 396 | - 'search_items' => __( 'Search Course Categories', 'woothemes-sensei' ), |
|
| 397 | - 'all_items' => __( 'All Course Categories', 'woothemes-sensei' ), |
|
| 398 | - 'parent_item' => __( 'Parent Course Category', 'woothemes-sensei' ), |
|
| 399 | - 'parent_item_colon' => __( 'Parent Course Category:', 'woothemes-sensei' ), |
|
| 400 | - 'edit_item' => __( 'Edit Course Category', 'woothemes-sensei' ), |
|
| 401 | - 'update_item' => __( 'Update Course Category', 'woothemes-sensei' ), |
|
| 402 | - 'add_new_item' => __( 'Add New Course Category', 'woothemes-sensei' ), |
|
| 403 | - 'new_item_name' => __( 'New Course Category Name', 'woothemes-sensei' ), |
|
| 404 | - 'menu_name' => __( 'Course Categories', 'woothemes-sensei' ), |
|
| 394 | + 'name' => _x('Course Categories', 'taxonomy general name', 'woothemes-sensei'), |
|
| 395 | + 'singular_name' => _x('Course Category', 'taxonomy singular name', 'woothemes-sensei'), |
|
| 396 | + 'search_items' => __('Search Course Categories', 'woothemes-sensei'), |
|
| 397 | + 'all_items' => __('All Course Categories', 'woothemes-sensei'), |
|
| 398 | + 'parent_item' => __('Parent Course Category', 'woothemes-sensei'), |
|
| 399 | + 'parent_item_colon' => __('Parent Course Category:', 'woothemes-sensei'), |
|
| 400 | + 'edit_item' => __('Edit Course Category', 'woothemes-sensei'), |
|
| 401 | + 'update_item' => __('Update Course Category', 'woothemes-sensei'), |
|
| 402 | + 'add_new_item' => __('Add New Course Category', 'woothemes-sensei'), |
|
| 403 | + 'new_item_name' => __('New Course Category Name', 'woothemes-sensei'), |
|
| 404 | + 'menu_name' => __('Course Categories', 'woothemes-sensei'), |
|
| 405 | 405 | 'popular_items' => null // Hides the "Popular" section above the "add" form in the admin. |
| 406 | 406 | ); |
| 407 | 407 | |
@@ -416,10 +416,10 @@ discard block |
||
| 416 | 416 | 'edit_terms' => 'edit_courses', |
| 417 | 417 | 'delete_terms' => 'manage_categories', |
| 418 | 418 | 'assign_terms' => 'edit_courses',), |
| 419 | - 'rewrite' => array( 'slug' => esc_attr( apply_filters( 'sensei_course_category_slug', _x( 'course-category', 'taxonomy archive slug', 'woothemes-sensei' ) ) ) ) |
|
| 419 | + 'rewrite' => array('slug' => esc_attr(apply_filters('sensei_course_category_slug', _x('course-category', 'taxonomy archive slug', 'woothemes-sensei')))) |
|
| 420 | 420 | ); |
| 421 | 421 | |
| 422 | - register_taxonomy( 'course-category', array( 'course' ), $args ); |
|
| 422 | + register_taxonomy('course-category', array('course'), $args); |
|
| 423 | 423 | |
| 424 | 424 | } // End setup_course_category_taxonomy() |
| 425 | 425 | |
@@ -428,20 +428,20 @@ discard block |
||
| 428 | 428 | * @since 1.0.0 |
| 429 | 429 | * @return void |
| 430 | 430 | */ |
| 431 | - public function setup_quiz_type_taxonomy () { |
|
| 431 | + public function setup_quiz_type_taxonomy() { |
|
| 432 | 432 | // "Quiz Types" Custom Taxonomy |
| 433 | 433 | $labels = array( |
| 434 | - 'name' => _x( 'Quiz Types', 'taxonomy general name', 'woothemes-sensei' ), |
|
| 435 | - 'singular_name' => _x( 'Quiz Type', 'taxonomy singular name', 'woothemes-sensei' ), |
|
| 436 | - 'search_items' => __( 'Search Quiz Types', 'woothemes-sensei' ), |
|
| 437 | - 'all_items' => __( 'All Quiz Types', 'woothemes-sensei' ), |
|
| 438 | - 'parent_item' => __( 'Parent Quiz Type', 'woothemes-sensei' ), |
|
| 439 | - 'parent_item_colon' => __( 'Parent Quiz Type:', 'woothemes-sensei' ), |
|
| 440 | - 'edit_item' => __( 'Edit Quiz Type', 'woothemes-sensei' ), |
|
| 441 | - 'update_item' => __( 'Update Quiz Type', 'woothemes-sensei' ), |
|
| 442 | - 'add_new_item' => __( 'Add New Quiz Type', 'woothemes-sensei' ), |
|
| 443 | - 'new_item_name' => __( 'New Quiz Type Name', 'woothemes-sensei' ), |
|
| 444 | - 'menu_name' => __( 'Quiz Types', 'woothemes-sensei' ), |
|
| 434 | + 'name' => _x('Quiz Types', 'taxonomy general name', 'woothemes-sensei'), |
|
| 435 | + 'singular_name' => _x('Quiz Type', 'taxonomy singular name', 'woothemes-sensei'), |
|
| 436 | + 'search_items' => __('Search Quiz Types', 'woothemes-sensei'), |
|
| 437 | + 'all_items' => __('All Quiz Types', 'woothemes-sensei'), |
|
| 438 | + 'parent_item' => __('Parent Quiz Type', 'woothemes-sensei'), |
|
| 439 | + 'parent_item_colon' => __('Parent Quiz Type:', 'woothemes-sensei'), |
|
| 440 | + 'edit_item' => __('Edit Quiz Type', 'woothemes-sensei'), |
|
| 441 | + 'update_item' => __('Update Quiz Type', 'woothemes-sensei'), |
|
| 442 | + 'add_new_item' => __('Add New Quiz Type', 'woothemes-sensei'), |
|
| 443 | + 'new_item_name' => __('New Quiz Type Name', 'woothemes-sensei'), |
|
| 444 | + 'menu_name' => __('Quiz Types', 'woothemes-sensei'), |
|
| 445 | 445 | 'popular_items' => null // Hides the "Popular" section above the "add" form in the admin. |
| 446 | 446 | ); |
| 447 | 447 | |
@@ -452,10 +452,10 @@ discard block |
||
| 452 | 452 | 'query_var' => true, |
| 453 | 453 | 'show_in_nav_menus' => false, |
| 454 | 454 | 'public' => false, |
| 455 | - 'rewrite' => array( 'slug' => esc_attr( apply_filters( 'sensei_quiz_type_slug', _x( 'quiz-type', 'taxonomy archive slug', 'woothemes-sensei' ) ) ) ) |
|
| 455 | + 'rewrite' => array('slug' => esc_attr(apply_filters('sensei_quiz_type_slug', _x('quiz-type', 'taxonomy archive slug', 'woothemes-sensei')))) |
|
| 456 | 456 | ); |
| 457 | 457 | |
| 458 | - register_taxonomy( 'quiz-type', array( 'quiz' ), $args ); |
|
| 458 | + register_taxonomy('quiz-type', array('quiz'), $args); |
|
| 459 | 459 | } // End setup_quiz_type_taxonomy() |
| 460 | 460 | |
| 461 | 461 | /** |
@@ -463,20 +463,20 @@ discard block |
||
| 463 | 463 | * @since 1.3.0 |
| 464 | 464 | * @return void |
| 465 | 465 | */ |
| 466 | - public function setup_question_type_taxonomy () { |
|
| 466 | + public function setup_question_type_taxonomy() { |
|
| 467 | 467 | // "Question Types" Custom Taxonomy |
| 468 | 468 | $labels = array( |
| 469 | - 'name' => _x( 'Question Types', 'taxonomy general name', 'woothemes-sensei' ), |
|
| 470 | - 'singular_name' => _x( 'Question Type', 'taxonomy singular name', 'woothemes-sensei' ), |
|
| 471 | - 'search_items' => __( 'Search Question Types', 'woothemes-sensei' ), |
|
| 472 | - 'all_items' => __( 'All Question Types', 'woothemes-sensei' ), |
|
| 473 | - 'parent_item' => __( 'Parent Question Type', 'woothemes-sensei' ), |
|
| 474 | - 'parent_item_colon' => __( 'Parent Question Type:', 'woothemes-sensei' ), |
|
| 475 | - 'edit_item' => __( 'Edit Question Type', 'woothemes-sensei' ), |
|
| 476 | - 'update_item' => __( 'Update Question Type', 'woothemes-sensei' ), |
|
| 477 | - 'add_new_item' => __( 'Add New Question Type', 'woothemes-sensei' ), |
|
| 478 | - 'new_item_name' => __( 'New Question Type Name', 'woothemes-sensei' ), |
|
| 479 | - 'menu_name' => __( 'Question Types', 'woothemes-sensei' ), |
|
| 469 | + 'name' => _x('Question Types', 'taxonomy general name', 'woothemes-sensei'), |
|
| 470 | + 'singular_name' => _x('Question Type', 'taxonomy singular name', 'woothemes-sensei'), |
|
| 471 | + 'search_items' => __('Search Question Types', 'woothemes-sensei'), |
|
| 472 | + 'all_items' => __('All Question Types', 'woothemes-sensei'), |
|
| 473 | + 'parent_item' => __('Parent Question Type', 'woothemes-sensei'), |
|
| 474 | + 'parent_item_colon' => __('Parent Question Type:', 'woothemes-sensei'), |
|
| 475 | + 'edit_item' => __('Edit Question Type', 'woothemes-sensei'), |
|
| 476 | + 'update_item' => __('Update Question Type', 'woothemes-sensei'), |
|
| 477 | + 'add_new_item' => __('Add New Question Type', 'woothemes-sensei'), |
|
| 478 | + 'new_item_name' => __('New Question Type Name', 'woothemes-sensei'), |
|
| 479 | + 'menu_name' => __('Question Types', 'woothemes-sensei'), |
|
| 480 | 480 | 'popular_items' => null // Hides the "Popular" section above the "add" form in the admin. |
| 481 | 481 | ); |
| 482 | 482 | |
@@ -488,10 +488,10 @@ discard block |
||
| 488 | 488 | 'query_var' => false, |
| 489 | 489 | 'show_in_nav_menus' => false, |
| 490 | 490 | 'show_admin_column' => true, |
| 491 | - 'rewrite' => array( 'slug' => esc_attr( apply_filters( 'sensei_question_type_slug', _x( 'question-type', 'taxonomy archive slug', 'woothemes-sensei' ) ) ) ) |
|
| 491 | + 'rewrite' => array('slug' => esc_attr(apply_filters('sensei_question_type_slug', _x('question-type', 'taxonomy archive slug', 'woothemes-sensei')))) |
|
| 492 | 492 | ); |
| 493 | 493 | |
| 494 | - register_taxonomy( 'question-type', array( 'question' ), $args ); |
|
| 494 | + register_taxonomy('question-type', array('question'), $args); |
|
| 495 | 495 | } // End setup_question_type_taxonomy() |
| 496 | 496 | |
| 497 | 497 | /** |
@@ -499,20 +499,20 @@ discard block |
||
| 499 | 499 | * @since 1.3.0 |
| 500 | 500 | * @return void |
| 501 | 501 | */ |
| 502 | - public function setup_question_category_taxonomy () { |
|
| 502 | + public function setup_question_category_taxonomy() { |
|
| 503 | 503 | // "Question Categories" Custom Taxonomy |
| 504 | 504 | $labels = array( |
| 505 | - 'name' => _x( 'Question Categories', 'taxonomy general name', 'woothemes-sensei' ), |
|
| 506 | - 'singular_name' => _x( 'Question Category', 'taxonomy singular name', 'woothemes-sensei' ), |
|
| 507 | - 'search_items' => __( 'Search Question Categories', 'woothemes-sensei' ), |
|
| 508 | - 'all_items' => __( 'All Question Categories', 'woothemes-sensei' ), |
|
| 509 | - 'parent_item' => __( 'Parent Question Category', 'woothemes-sensei' ), |
|
| 510 | - 'parent_item_colon' => __( 'Parent Question Category:', 'woothemes-sensei' ), |
|
| 511 | - 'edit_item' => __( 'Edit Question Category', 'woothemes-sensei' ), |
|
| 512 | - 'update_item' => __( 'Update Question Category', 'woothemes-sensei' ), |
|
| 513 | - 'add_new_item' => __( 'Add New Question Category', 'woothemes-sensei' ), |
|
| 514 | - 'new_item_name' => __( 'New Question Category Name', 'woothemes-sensei' ), |
|
| 515 | - 'menu_name' => __( 'Categories', 'woothemes-sensei' ), |
|
| 505 | + 'name' => _x('Question Categories', 'taxonomy general name', 'woothemes-sensei'), |
|
| 506 | + 'singular_name' => _x('Question Category', 'taxonomy singular name', 'woothemes-sensei'), |
|
| 507 | + 'search_items' => __('Search Question Categories', 'woothemes-sensei'), |
|
| 508 | + 'all_items' => __('All Question Categories', 'woothemes-sensei'), |
|
| 509 | + 'parent_item' => __('Parent Question Category', 'woothemes-sensei'), |
|
| 510 | + 'parent_item_colon' => __('Parent Question Category:', 'woothemes-sensei'), |
|
| 511 | + 'edit_item' => __('Edit Question Category', 'woothemes-sensei'), |
|
| 512 | + 'update_item' => __('Update Question Category', 'woothemes-sensei'), |
|
| 513 | + 'add_new_item' => __('Add New Question Category', 'woothemes-sensei'), |
|
| 514 | + 'new_item_name' => __('New Question Category Name', 'woothemes-sensei'), |
|
| 515 | + 'menu_name' => __('Categories', 'woothemes-sensei'), |
|
| 516 | 516 | ); |
| 517 | 517 | |
| 518 | 518 | $args = array( |
@@ -528,10 +528,10 @@ discard block |
||
| 528 | 528 | 'edit_terms' => 'edit_questions', |
| 529 | 529 | 'delete_terms' => 'manage_categories', |
| 530 | 530 | 'assign_terms' => 'edit_questions',), |
| 531 | - 'rewrite' => array( 'slug' => esc_attr( apply_filters( 'sensei_question_category_slug', _x( 'question-category', 'taxonomy archive slug', 'woothemes-sensei' ) ) ) ) |
|
| 531 | + 'rewrite' => array('slug' => esc_attr(apply_filters('sensei_question_category_slug', _x('question-category', 'taxonomy archive slug', 'woothemes-sensei')))) |
|
| 532 | 532 | ); |
| 533 | 533 | |
| 534 | - register_taxonomy( 'question-category', array( 'question' ), $args ); |
|
| 534 | + register_taxonomy('question-category', array('question'), $args); |
|
| 535 | 535 | } // End setup_question_type_taxonomy() |
| 536 | 536 | |
| 537 | 537 | /** |
@@ -539,20 +539,20 @@ discard block |
||
| 539 | 539 | * @since 1.5.0 |
| 540 | 540 | * @return void |
| 541 | 541 | */ |
| 542 | - public function setup_lesson_tag_taxonomy () { |
|
| 542 | + public function setup_lesson_tag_taxonomy() { |
|
| 543 | 543 | // "Lesson Tags" Custom Taxonomy |
| 544 | 544 | $labels = array( |
| 545 | - 'name' => _x( 'Lesson Tags', 'taxonomy general name', 'woothemes-sensei' ), |
|
| 546 | - 'singular_name' => _x( 'Lesson Tag', 'taxonomy singular name', 'woothemes-sensei' ), |
|
| 547 | - 'search_items' => __( 'Search Lesson Tags', 'woothemes-sensei' ), |
|
| 548 | - 'all_items' => __( 'All Lesson Tags', 'woothemes-sensei' ), |
|
| 549 | - 'parent_item' => __( 'Parent Tag', 'woothemes-sensei' ), |
|
| 550 | - 'parent_item_colon' => __( 'Parent Tag:', 'woothemes-sensei' ), |
|
| 551 | - 'edit_item' => __( 'Edit Lesson Tag', 'woothemes-sensei' ), |
|
| 552 | - 'update_item' => __( 'Update Lesson Tag', 'woothemes-sensei' ), |
|
| 553 | - 'add_new_item' => __( 'Add New Lesson Tag', 'woothemes-sensei' ), |
|
| 554 | - 'new_item_name' => __( 'New Tag Name', 'woothemes-sensei' ), |
|
| 555 | - 'menu_name' => __( 'Lesson Tags', 'woothemes-sensei' ) |
|
| 545 | + 'name' => _x('Lesson Tags', 'taxonomy general name', 'woothemes-sensei'), |
|
| 546 | + 'singular_name' => _x('Lesson Tag', 'taxonomy singular name', 'woothemes-sensei'), |
|
| 547 | + 'search_items' => __('Search Lesson Tags', 'woothemes-sensei'), |
|
| 548 | + 'all_items' => __('All Lesson Tags', 'woothemes-sensei'), |
|
| 549 | + 'parent_item' => __('Parent Tag', 'woothemes-sensei'), |
|
| 550 | + 'parent_item_colon' => __('Parent Tag:', 'woothemes-sensei'), |
|
| 551 | + 'edit_item' => __('Edit Lesson Tag', 'woothemes-sensei'), |
|
| 552 | + 'update_item' => __('Update Lesson Tag', 'woothemes-sensei'), |
|
| 553 | + 'add_new_item' => __('Add New Lesson Tag', 'woothemes-sensei'), |
|
| 554 | + 'new_item_name' => __('New Tag Name', 'woothemes-sensei'), |
|
| 555 | + 'menu_name' => __('Lesson Tags', 'woothemes-sensei') |
|
| 556 | 556 | ); |
| 557 | 557 | |
| 558 | 558 | $args = array( |
@@ -566,10 +566,10 @@ discard block |
||
| 566 | 566 | 'edit_terms' => 'edit_lessons', |
| 567 | 567 | 'delete_terms' => 'manage_categories', |
| 568 | 568 | 'assign_terms' => 'edit_lessons',), |
| 569 | - 'rewrite' => array( 'slug' => esc_attr( apply_filters( 'sensei_lesson_tag_slug', _x( 'lesson-tag', 'taxonomy archive slug', 'woothemes-sensei' ) ) ) ) |
|
| 569 | + 'rewrite' => array('slug' => esc_attr(apply_filters('sensei_lesson_tag_slug', _x('lesson-tag', 'taxonomy archive slug', 'woothemes-sensei')))) |
|
| 570 | 570 | ); |
| 571 | 571 | |
| 572 | - register_taxonomy( 'lesson-tag', array( 'lesson' ), $args ); |
|
| 572 | + register_taxonomy('lesson-tag', array('lesson'), $args); |
|
| 573 | 573 | } // End setup_lesson_tag_taxonomy() |
| 574 | 574 | |
| 575 | 575 | /** |
@@ -577,15 +577,15 @@ discard block |
||
| 577 | 577 | * @since 1.0.0 |
| 578 | 578 | * @return void |
| 579 | 579 | */ |
| 580 | - private function setup_post_type_labels_base () { |
|
| 581 | - $this->labels = array( 'course' => array(), 'lesson' => array(), 'quiz' => array(), 'question' => array() ); |
|
| 580 | + private function setup_post_type_labels_base() { |
|
| 581 | + $this->labels = array('course' => array(), 'lesson' => array(), 'quiz' => array(), 'question' => array()); |
|
| 582 | 582 | |
| 583 | - $this->labels['course'] = array( 'singular' => __( 'Course', 'woothemes-sensei' ), 'plural' => __( 'Courses', 'woothemes-sensei' ), 'menu' => __( 'Courses', 'woothemes-sensei' ) ); |
|
| 584 | - $this->labels['lesson'] = array( 'singular' => __( 'Lesson', 'woothemes-sensei' ), 'plural' => __( 'Lessons', 'woothemes-sensei' ), 'menu' => __( 'Lessons', 'woothemes-sensei' ) ); |
|
| 585 | - $this->labels['quiz'] = array( 'singular' => __( 'Quiz', 'woothemes-sensei' ), 'plural' => __( 'Quizzes', 'woothemes-sensei' ), 'menu' => __( 'Quizzes', 'woothemes-sensei' ) ); |
|
| 586 | - $this->labels['question'] = array( 'singular' => __( 'Question', 'woothemes-sensei' ), 'plural' => __( 'Questions', 'woothemes-sensei' ), 'menu' => __( 'Questions', 'woothemes-sensei' ) ); |
|
| 587 | - $this->labels['multiple_question'] = array( 'singular' => __( 'Multiple Question', 'woothemes-sensei' ), 'plural' => __( 'Multiple Questions', 'woothemes-sensei' ), 'menu' => __( 'Multiple Questions', 'woothemes-sensei' ) ); |
|
| 588 | - $this->labels['sensei_message'] = array( 'singular' => __( 'Message', 'woothemes-sensei' ), 'plural' => __( 'Messages', 'woothemes-sensei' ), 'menu' => __( 'Messages', 'woothemes-sensei' ) ); |
|
| 583 | + $this->labels['course'] = array('singular' => __('Course', 'woothemes-sensei'), 'plural' => __('Courses', 'woothemes-sensei'), 'menu' => __('Courses', 'woothemes-sensei')); |
|
| 584 | + $this->labels['lesson'] = array('singular' => __('Lesson', 'woothemes-sensei'), 'plural' => __('Lessons', 'woothemes-sensei'), 'menu' => __('Lessons', 'woothemes-sensei')); |
|
| 585 | + $this->labels['quiz'] = array('singular' => __('Quiz', 'woothemes-sensei'), 'plural' => __('Quizzes', 'woothemes-sensei'), 'menu' => __('Quizzes', 'woothemes-sensei')); |
|
| 586 | + $this->labels['question'] = array('singular' => __('Question', 'woothemes-sensei'), 'plural' => __('Questions', 'woothemes-sensei'), 'menu' => __('Questions', 'woothemes-sensei')); |
|
| 587 | + $this->labels['multiple_question'] = array('singular' => __('Multiple Question', 'woothemes-sensei'), 'plural' => __('Multiple Questions', 'woothemes-sensei'), 'menu' => __('Multiple Questions', 'woothemes-sensei')); |
|
| 588 | + $this->labels['sensei_message'] = array('singular' => __('Message', 'woothemes-sensei'), 'plural' => __('Messages', 'woothemes-sensei'), 'menu' => __('Messages', 'woothemes-sensei')); |
|
| 589 | 589 | |
| 590 | 590 | } // End setup_post_type_labels_base() |
| 591 | 591 | |
@@ -598,21 +598,21 @@ discard block |
||
| 598 | 598 | * @param string $menu The menu item label |
| 599 | 599 | * @return array An array of the labels to be used |
| 600 | 600 | */ |
| 601 | - private function create_post_type_labels ( $token, $singular, $plural, $menu ) { |
|
| 601 | + private function create_post_type_labels($token, $singular, $plural, $menu) { |
|
| 602 | 602 | $labels = array( |
| 603 | - 'name' => sprintf( _x( '%s', 'post type general name', 'woothemes-sensei' ), $plural ), |
|
| 604 | - 'singular_name' => sprintf( _x( '%s', 'post type singular name', 'woothemes-sensei' ), $singular ), |
|
| 605 | - 'add_new' => __( 'Add New', 'woothemes-sensei' ), |
|
| 606 | - 'add_new_item' => sprintf( __( 'Add New %s', 'woothemes-sensei' ), $singular ), |
|
| 607 | - 'edit_item' => sprintf( __( 'Edit %s', 'woothemes-sensei' ), $singular ), |
|
| 608 | - 'new_item' => sprintf( __( 'New %s', 'woothemes-sensei' ), $singular ), |
|
| 609 | - 'all_items' => sprintf( __( 'All %s', 'woothemes-sensei' ), $plural ), |
|
| 610 | - 'view_item' => sprintf( __( 'View %s', 'woothemes-sensei' ), $singular ), |
|
| 611 | - 'search_items' => sprintf( __( 'Search %s', 'woothemes-sensei' ), $plural ), |
|
| 612 | - 'not_found' => sprintf( __( 'No %s found', 'woothemes-sensei' ), mb_strtolower( $plural, 'UTF-8') ), |
|
| 613 | - 'not_found_in_trash' => sprintf( __( 'No %s found in Trash', 'woothemes-sensei' ), mb_strtolower( $plural, 'UTF-8') ), |
|
| 603 | + 'name' => sprintf(_x('%s', 'post type general name', 'woothemes-sensei'), $plural), |
|
| 604 | + 'singular_name' => sprintf(_x('%s', 'post type singular name', 'woothemes-sensei'), $singular), |
|
| 605 | + 'add_new' => __('Add New', 'woothemes-sensei'), |
|
| 606 | + 'add_new_item' => sprintf(__('Add New %s', 'woothemes-sensei'), $singular), |
|
| 607 | + 'edit_item' => sprintf(__('Edit %s', 'woothemes-sensei'), $singular), |
|
| 608 | + 'new_item' => sprintf(__('New %s', 'woothemes-sensei'), $singular), |
|
| 609 | + 'all_items' => sprintf(__('All %s', 'woothemes-sensei'), $plural), |
|
| 610 | + 'view_item' => sprintf(__('View %s', 'woothemes-sensei'), $singular), |
|
| 611 | + 'search_items' => sprintf(__('Search %s', 'woothemes-sensei'), $plural), |
|
| 612 | + 'not_found' => sprintf(__('No %s found', 'woothemes-sensei'), mb_strtolower($plural, 'UTF-8')), |
|
| 613 | + 'not_found_in_trash' => sprintf(__('No %s found in Trash', 'woothemes-sensei'), mb_strtolower($plural, 'UTF-8')), |
|
| 614 | 614 | 'parent_item_colon' => '', |
| 615 | - 'menu_name' => sprintf( __( '%s', 'woothemes-sensei' ), $menu ) |
|
| 615 | + 'menu_name' => sprintf(__('%s', 'woothemes-sensei'), $menu) |
|
| 616 | 616 | ); |
| 617 | 617 | |
| 618 | 618 | return $labels; |
@@ -624,14 +624,14 @@ discard block |
||
| 624 | 624 | * @param array $messages The existing array of messages for post types. |
| 625 | 625 | * @return array The modified array of messages for post types. |
| 626 | 626 | */ |
| 627 | - public function setup_post_type_messages ( $messages ) { |
|
| 627 | + public function setup_post_type_messages($messages) { |
|
| 628 | 628 | global $post, $post_ID; |
| 629 | 629 | |
| 630 | - $messages['course'] = $this->create_post_type_messages( 'course' ); |
|
| 631 | - $messages['lesson'] = $this->create_post_type_messages( 'lesson' ); |
|
| 632 | - $messages['quiz'] = $this->create_post_type_messages( 'quiz' ); |
|
| 633 | - $messages['question'] = $this->create_post_type_messages( 'question' ); |
|
| 634 | - $messages['multiple_question'] = $this->create_post_type_messages( 'multiple_question' ); |
|
| 630 | + $messages['course'] = $this->create_post_type_messages('course'); |
|
| 631 | + $messages['lesson'] = $this->create_post_type_messages('lesson'); |
|
| 632 | + $messages['quiz'] = $this->create_post_type_messages('quiz'); |
|
| 633 | + $messages['question'] = $this->create_post_type_messages('question'); |
|
| 634 | + $messages['multiple_question'] = $this->create_post_type_messages('multiple_question'); |
|
| 635 | 635 | |
| 636 | 636 | return $messages; |
| 637 | 637 | } // End setup_post_type_messages() |
@@ -642,23 +642,23 @@ discard block |
||
| 642 | 642 | * @param string $post_type The post type for which to create messages. |
| 643 | 643 | * @return array An array of messages (empty array if the post type isn't one we're looking to work with). |
| 644 | 644 | */ |
| 645 | - private function create_post_type_messages ( $post_type ) { |
|
| 645 | + private function create_post_type_messages($post_type) { |
|
| 646 | 646 | global $post, $post_ID; |
| 647 | 647 | |
| 648 | - if ( ! isset( $this->labels[$post_type] ) ) { return array(); } |
|
| 648 | + if ( ! isset($this->labels[$post_type])) { return array(); } |
|
| 649 | 649 | |
| 650 | 650 | $messages = array( |
| 651 | 651 | 0 => '', |
| 652 | - 1 => sprintf( __( '%1$s updated. %2$sView %1$s%3$s.' , 'woothemes-sensei' ), $this->labels[$post_type]['singular'], '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ), |
|
| 653 | - 2 => __( 'Custom field updated.' , 'woothemes-sensei' ), |
|
| 654 | - 3 => __( 'Custom field deleted.' , 'woothemes-sensei' ), |
|
| 655 | - 4 => sprintf( __( '%1$s updated.' , 'woothemes-sensei' ), $this->labels[$post_type]['singular'] ), |
|
| 656 | - 5 => isset( $_GET['revision'] ) ? sprintf( __( '%1$s restored to revision from %2$s.' , 'woothemes-sensei' ), $this->labels[$post_type]['singular'], wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, |
|
| 657 | - 6 => sprintf( __( '%1$s published. %2$sView %1$s%3$s.' , 'woothemes-sensei' ), $this->labels[$post_type]['singular'], '<a href="' . esc_url( get_permalink( $post_ID ) ) . '">', '</a>' ), |
|
| 658 | - 7 => sprintf( __( '%1$s saved.' , 'woothemes-sensei' ), $this->labels[$post_type]['singular'] ), |
|
| 659 | - 8 => sprintf( __( '%1$s submitted. %2$sPreview %1$s%3$s.' , 'woothemes-sensei' ), $this->labels[$post_type]['singular'], '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) . '">', '</a>' ), |
|
| 660 | - 9 => sprintf( __( '%1$s scheduled for: %2$s. %3$sPreview %4$s%5$s.' , 'woothemes-sensei' ), $this->labels[$post_type]['singular'], '<strong>' . date_i18n( __( 'M j, Y @ G:i' , 'woothemes-sensei' ), strtotime( $post->post_date ) ) . '</strong>', '<a target="_blank" href="' . esc_url( get_permalink( $post_ID ) ) . '">', $this->labels[$post_type]['singular'], '</a>' ), |
|
| 661 | - 10 => sprintf( __( '%1$s draft updated. %2$sPreview %3$s%4$s.' , 'woothemes-sensei' ), $this->labels[$post_type]['singular'], '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) . '">', $this->labels[$post_type]['singular'], '</a>' ), |
|
| 652 | + 1 => sprintf(__('%1$s updated. %2$sView %1$s%3$s.', 'woothemes-sensei'), $this->labels[$post_type]['singular'], '<a href="'.esc_url(get_permalink($post_ID)).'">', '</a>'), |
|
| 653 | + 2 => __('Custom field updated.', 'woothemes-sensei'), |
|
| 654 | + 3 => __('Custom field deleted.', 'woothemes-sensei'), |
|
| 655 | + 4 => sprintf(__('%1$s updated.', 'woothemes-sensei'), $this->labels[$post_type]['singular']), |
|
| 656 | + 5 => isset($_GET['revision']) ? sprintf(__('%1$s restored to revision from %2$s.', 'woothemes-sensei'), $this->labels[$post_type]['singular'], wp_post_revision_title((int) $_GET['revision'], false)) : false, |
|
| 657 | + 6 => sprintf(__('%1$s published. %2$sView %1$s%3$s.', 'woothemes-sensei'), $this->labels[$post_type]['singular'], '<a href="'.esc_url(get_permalink($post_ID)).'">', '</a>'), |
|
| 658 | + 7 => sprintf(__('%1$s saved.', 'woothemes-sensei'), $this->labels[$post_type]['singular']), |
|
| 659 | + 8 => sprintf(__('%1$s submitted. %2$sPreview %1$s%3$s.', 'woothemes-sensei'), $this->labels[$post_type]['singular'], '<a target="_blank" href="'.esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))).'">', '</a>'), |
|
| 660 | + 9 => sprintf(__('%1$s scheduled for: %2$s. %3$sPreview %4$s%5$s.', 'woothemes-sensei'), $this->labels[$post_type]['singular'], '<strong>'.date_i18n(__('M j, Y @ G:i', 'woothemes-sensei'), strtotime($post->post_date)).'</strong>', '<a target="_blank" href="'.esc_url(get_permalink($post_ID)).'">', $this->labels[$post_type]['singular'], '</a>'), |
|
| 661 | + 10 => sprintf(__('%1$s draft updated. %2$sPreview %3$s%4$s.', 'woothemes-sensei'), $this->labels[$post_type]['singular'], '<a target="_blank" href="'.esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))).'">', $this->labels[$post_type]['singular'], '</a>'), |
|
| 662 | 662 | ); |
| 663 | 663 | |
| 664 | 664 | return $messages; |
@@ -671,11 +671,11 @@ discard block |
||
| 671 | 671 | * @param string $title |
| 672 | 672 | * @return string $title |
| 673 | 673 | */ |
| 674 | - public function enter_title_here ( $title ) { |
|
| 675 | - if ( get_post_type() == 'course' ) { |
|
| 676 | - $title = __( 'Enter a title for this course here', 'woothemes-sensei' ); |
|
| 677 | - } elseif ( get_post_type() == 'lesson' ) { |
|
| 678 | - $title = __( 'Enter a title for this lesson here', 'woothemes-sensei' ); |
|
| 674 | + public function enter_title_here($title) { |
|
| 675 | + if (get_post_type() == 'course') { |
|
| 676 | + $title = __('Enter a title for this course here', 'woothemes-sensei'); |
|
| 677 | + } elseif (get_post_type() == 'lesson') { |
|
| 678 | + $title = __('Enter a title for this lesson here', 'woothemes-sensei'); |
|
| 679 | 679 | } |
| 680 | 680 | |
| 681 | 681 | return $title; |
@@ -688,60 +688,60 @@ discard block |
||
| 688 | 688 | * @access public |
| 689 | 689 | * @return void |
| 690 | 690 | */ |
| 691 | - public function set_role_cap_defaults( $post_types = array() ) { |
|
| 691 | + public function set_role_cap_defaults($post_types = array()) { |
|
| 692 | 692 | |
| 693 | - foreach ( $post_types as $post_type_item => $post_type_name ) { |
|
| 693 | + foreach ($post_types as $post_type_item => $post_type_name) { |
|
| 694 | 694 | // Super Admin |
| 695 | - $this->role_caps[] = array( 'administrator' => array( 'edit_' . $post_type_item, |
|
| 696 | - 'read_' . $post_type_item, |
|
| 697 | - 'delete_' . $post_type_item, |
|
| 698 | - 'create_' . $post_type_item . 's', |
|
| 699 | - 'edit_' . $post_type_item . 's', |
|
| 700 | - 'edit_others_' . $post_type_item . 's', |
|
| 701 | - 'publish_' . $post_type_item . 's', |
|
| 702 | - 'read_private_' . $post_type_item . 's', |
|
| 695 | + $this->role_caps[] = array('administrator' => array('edit_'.$post_type_item, |
|
| 696 | + 'read_'.$post_type_item, |
|
| 697 | + 'delete_'.$post_type_item, |
|
| 698 | + 'create_'.$post_type_item.'s', |
|
| 699 | + 'edit_'.$post_type_item.'s', |
|
| 700 | + 'edit_others_'.$post_type_item.'s', |
|
| 701 | + 'publish_'.$post_type_item.'s', |
|
| 702 | + 'read_private_'.$post_type_item.'s', |
|
| 703 | 703 | 'read', |
| 704 | - 'delete_' . $post_type_item . 's', |
|
| 705 | - 'delete_private_' . $post_type_item . 's', |
|
| 706 | - 'delete_published_' . $post_type_item . 's', |
|
| 707 | - 'delete_others_' . $post_type_item . 's', |
|
| 708 | - 'edit_private_' . $post_type_item . 's', |
|
| 709 | - 'edit_published_' . $post_type_item . 's', |
|
| 704 | + 'delete_'.$post_type_item.'s', |
|
| 705 | + 'delete_private_'.$post_type_item.'s', |
|
| 706 | + 'delete_published_'.$post_type_item.'s', |
|
| 707 | + 'delete_others_'.$post_type_item.'s', |
|
| 708 | + 'edit_private_'.$post_type_item.'s', |
|
| 709 | + 'edit_published_'.$post_type_item.'s', |
|
| 710 | 710 | 'manage_sensei', |
| 711 | - 'manage_sensei_grades' ), |
|
| 712 | - 'editor' => array( 'edit_' . $post_type_item, |
|
| 713 | - 'read_' . $post_type_item, |
|
| 714 | - 'delete_' . $post_type_item, |
|
| 715 | - 'create_' . $post_type_item . 's', |
|
| 716 | - 'edit_' . $post_type_item . 's', |
|
| 717 | - 'edit_others_' . $post_type_item . 's', |
|
| 718 | - 'publish_' . $post_type_item . 's', |
|
| 719 | - 'read_private_' . $post_type_item . 's', |
|
| 711 | + 'manage_sensei_grades'), |
|
| 712 | + 'editor' => array('edit_'.$post_type_item, |
|
| 713 | + 'read_'.$post_type_item, |
|
| 714 | + 'delete_'.$post_type_item, |
|
| 715 | + 'create_'.$post_type_item.'s', |
|
| 716 | + 'edit_'.$post_type_item.'s', |
|
| 717 | + 'edit_others_'.$post_type_item.'s', |
|
| 718 | + 'publish_'.$post_type_item.'s', |
|
| 719 | + 'read_private_'.$post_type_item.'s', |
|
| 720 | 720 | 'read', |
| 721 | - 'delete_' . $post_type_item . 's', |
|
| 722 | - 'delete_private_' . $post_type_item . 's', |
|
| 723 | - 'delete_published_' . $post_type_item . 's', |
|
| 724 | - 'delete_others_' . $post_type_item . 's', |
|
| 725 | - 'edit_private_' . $post_type_item . 's', |
|
| 726 | - 'edit_published_' . $post_type_item . 's' ), |
|
| 727 | - 'author' => array( 'edit_' . $post_type_item, |
|
| 728 | - 'read_' . $post_type_item, |
|
| 729 | - 'delete_' . $post_type_item, |
|
| 730 | - 'create_' . $post_type_item . 's', |
|
| 731 | - 'edit_' . $post_type_item . 's', |
|
| 732 | - 'publish_' . $post_type_item . 's', |
|
| 721 | + 'delete_'.$post_type_item.'s', |
|
| 722 | + 'delete_private_'.$post_type_item.'s', |
|
| 723 | + 'delete_published_'.$post_type_item.'s', |
|
| 724 | + 'delete_others_'.$post_type_item.'s', |
|
| 725 | + 'edit_private_'.$post_type_item.'s', |
|
| 726 | + 'edit_published_'.$post_type_item.'s'), |
|
| 727 | + 'author' => array('edit_'.$post_type_item, |
|
| 728 | + 'read_'.$post_type_item, |
|
| 729 | + 'delete_'.$post_type_item, |
|
| 730 | + 'create_'.$post_type_item.'s', |
|
| 731 | + 'edit_'.$post_type_item.'s', |
|
| 732 | + 'publish_'.$post_type_item.'s', |
|
| 733 | 733 | 'read', |
| 734 | - 'delete_' . $post_type_item . 's', |
|
| 735 | - 'delete_published_' . $post_type_item . 's', |
|
| 736 | - 'edit_published_' . $post_type_item . 's' ), |
|
| 737 | - 'contributor' => array( 'edit_' . $post_type_item, |
|
| 738 | - 'read_' . $post_type_item, |
|
| 739 | - 'delete_' . $post_type_item, |
|
| 740 | - 'create_' . $post_type_item . 's', |
|
| 741 | - 'edit_' . $post_type_item . 's', |
|
| 734 | + 'delete_'.$post_type_item.'s', |
|
| 735 | + 'delete_published_'.$post_type_item.'s', |
|
| 736 | + 'edit_published_'.$post_type_item.'s'), |
|
| 737 | + 'contributor' => array('edit_'.$post_type_item, |
|
| 738 | + 'read_'.$post_type_item, |
|
| 739 | + 'delete_'.$post_type_item, |
|
| 740 | + 'create_'.$post_type_item.'s', |
|
| 741 | + 'edit_'.$post_type_item.'s', |
|
| 742 | 742 | 'read', |
| 743 | - 'delete_' . $post_type_item . 's' ), |
|
| 744 | - 'subscriber' => array( 'read' ) |
|
| 743 | + 'delete_'.$post_type_item.'s'), |
|
| 744 | + 'subscriber' => array('read') |
|
| 745 | 745 | |
| 746 | 746 | ); |
| 747 | 747 | } // End For Loop |
@@ -754,16 +754,16 @@ discard block |
||
| 754 | 754 | * @since 1.7.0 |
| 755 | 755 | * @return void |
| 756 | 756 | */ |
| 757 | - public function quiz_admin_bar_menu( $bar ) { |
|
| 758 | - if ( is_single() && 'quiz' == get_queried_object()->post_type ) { |
|
| 759 | - $lesson_id = get_post_meta( get_queried_object()->ID, '_quiz_lesson', true ); |
|
| 760 | - if ( $lesson_id ) { |
|
| 757 | + public function quiz_admin_bar_menu($bar) { |
|
| 758 | + if (is_single() && 'quiz' == get_queried_object()->post_type) { |
|
| 759 | + $lesson_id = get_post_meta(get_queried_object()->ID, '_quiz_lesson', true); |
|
| 760 | + if ($lesson_id) { |
|
| 761 | 761 | $object_type = get_post_type_object('quiz'); |
| 762 | - $bar->add_menu( array( |
|
| 762 | + $bar->add_menu(array( |
|
| 763 | 763 | 'id' => 'edit', |
| 764 | 764 | 'title' => $object_type->labels->edit_item, |
| 765 | - 'href' => get_edit_post_link( $lesson_id ), |
|
| 766 | - ) ); |
|
| 765 | + 'href' => get_edit_post_link($lesson_id), |
|
| 766 | + )); |
|
| 767 | 767 | } |
| 768 | 768 | } |
| 769 | 769 | } |
@@ -775,4 +775,4 @@ discard block |
||
| 775 | 775 | * for backward compatibility |
| 776 | 776 | * @since 1.9.0 |
| 777 | 777 | */ |
| 778 | -class WooThemes_Sensei_PostTypes extends Sensei_PostTypes{} |
|
| 778 | +class WooThemes_Sensei_PostTypes extends Sensei_PostTypes {} |
|
@@ -1,5 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + exit; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Sensei Post Types Class |
@@ -146,7 +149,7 @@ discard block |
||
| 146 | 149 | |
| 147 | 150 | return get_page_uri( $settings_course_page->ID ); |
| 148 | 151 | |
| 149 | - }else{ |
|
| 152 | + } else{ |
|
| 150 | 153 | |
| 151 | 154 | return 'courses'; |
| 152 | 155 | |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 7 | 7 | |
| 8 | 8 | if ( class_exists( 'Teacher_New_Course_Assignment' ) ){ |
| 9 | - return; |
|
| 9 | + return; |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | /** |
@@ -40,40 +40,40 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | function __construct() { |
| 42 | 42 | |
| 43 | - $this->template = 'teacher-new-course-assignment'; |
|
| 43 | + $this->template = 'teacher-new-course-assignment'; |
|
| 44 | 44 | $this->subject = apply_filters( 'sensei_email_subject', sprintf( __( '[%1$s] You have been assigned to a course', 'woothemes-sensei' ), get_bloginfo( 'name' ) ), $this->template ); |
| 45 | 45 | $this->heading = apply_filters( 'sensei_email_heading', __( 'Course assigned to you', 'woothemes-sensei' ), $this->template ); |
| 46 | - return; |
|
| 46 | + return; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * trigger function. |
| 51 | 51 | * |
| 52 | 52 | * @access public |
| 53 | - * @param $teacher_id |
|
| 54 | - * @param $course_id |
|
| 53 | + * @param $teacher_id |
|
| 54 | + * @param $course_id |
|
| 55 | 55 | * @return void |
| 56 | 56 | */ |
| 57 | 57 | function trigger( $teacher_id = 0, $course_id = 0 ) { |
| 58 | 58 | global $sensei_email_data; |
| 59 | 59 | |
| 60 | 60 | $this->teacher = new WP_User( $teacher_id ); |
| 61 | - $this->recipient = stripslashes( $this->teacher->user_email ); |
|
| 62 | - $this->subject = __( 'New course assigned to you', 'woothemes-sensei' ); |
|
| 61 | + $this->recipient = stripslashes( $this->teacher->user_email ); |
|
| 62 | + $this->subject = __( 'New course assigned to you', 'woothemes-sensei' ); |
|
| 63 | 63 | |
| 64 | - //course edit link |
|
| 65 | - $course_edit_link = admin_url('post.php?post=' . $course_id . '&action=edit' ); |
|
| 64 | + //course edit link |
|
| 65 | + $course_edit_link = admin_url('post.php?post=' . $course_id . '&action=edit' ); |
|
| 66 | 66 | |
| 67 | - // Course name |
|
| 68 | - $course = get_post( $course_id); |
|
| 67 | + // Course name |
|
| 68 | + $course = get_post( $course_id); |
|
| 69 | 69 | // Construct data array |
| 70 | 70 | $sensei_email_data = apply_filters( 'sensei_email_data', array( |
| 71 | 71 | 'template' => $this->template, |
| 72 | 72 | 'heading' => $this->heading, |
| 73 | 73 | 'teacher_id' => $teacher_id, |
| 74 | 74 | 'course_id' => $course_id, |
| 75 | - 'course_name' => $course->post_title, |
|
| 76 | - 'course_edit_link' => $course_edit_link, |
|
| 75 | + 'course_name' => $course->post_title, |
|
| 76 | + 'course_edit_link' => $course_edit_link, |
|
| 77 | 77 | ), $this->template ); |
| 78 | 78 | |
| 79 | 79 | // Send mail |
@@ -3,9 +3,9 @@ discard block |
||
| 3 | 3 | * This email will be sent to a teacher when a course is assigned to them. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 6 | +if ( ! defined('ABSPATH')) exit; // Exit if accessed directly |
|
| 7 | 7 | |
| 8 | -if ( class_exists( 'Teacher_New_Course_Assignment' ) ){ |
|
| 8 | +if (class_exists('Teacher_New_Course_Assignment')) { |
|
| 9 | 9 | return; |
| 10 | 10 | } |
| 11 | 11 | |
@@ -41,8 +41,8 @@ discard block |
||
| 41 | 41 | function __construct() { |
| 42 | 42 | |
| 43 | 43 | $this->template = 'teacher-new-course-assignment'; |
| 44 | - $this->subject = apply_filters( 'sensei_email_subject', sprintf( __( '[%1$s] You have been assigned to a course', 'woothemes-sensei' ), get_bloginfo( 'name' ) ), $this->template ); |
|
| 45 | - $this->heading = apply_filters( 'sensei_email_heading', __( 'Course assigned to you', 'woothemes-sensei' ), $this->template ); |
|
| 44 | + $this->subject = apply_filters('sensei_email_subject', sprintf(__('[%1$s] You have been assigned to a course', 'woothemes-sensei'), get_bloginfo('name')), $this->template); |
|
| 45 | + $this->heading = apply_filters('sensei_email_heading', __('Course assigned to you', 'woothemes-sensei'), $this->template); |
|
| 46 | 46 | return; |
| 47 | 47 | } |
| 48 | 48 | |
@@ -54,29 +54,29 @@ discard block |
||
| 54 | 54 | * @param $course_id |
| 55 | 55 | * @return void |
| 56 | 56 | */ |
| 57 | - function trigger( $teacher_id = 0, $course_id = 0 ) { |
|
| 57 | + function trigger($teacher_id = 0, $course_id = 0) { |
|
| 58 | 58 | global $sensei_email_data; |
| 59 | 59 | |
| 60 | - $this->teacher = new WP_User( $teacher_id ); |
|
| 61 | - $this->recipient = stripslashes( $this->teacher->user_email ); |
|
| 62 | - $this->subject = __( 'New course assigned to you', 'woothemes-sensei' ); |
|
| 60 | + $this->teacher = new WP_User($teacher_id); |
|
| 61 | + $this->recipient = stripslashes($this->teacher->user_email); |
|
| 62 | + $this->subject = __('New course assigned to you', 'woothemes-sensei'); |
|
| 63 | 63 | |
| 64 | 64 | //course edit link |
| 65 | - $course_edit_link = admin_url('post.php?post=' . $course_id . '&action=edit' ); |
|
| 65 | + $course_edit_link = admin_url('post.php?post='.$course_id.'&action=edit'); |
|
| 66 | 66 | |
| 67 | 67 | // Course name |
| 68 | - $course = get_post( $course_id); |
|
| 68 | + $course = get_post($course_id); |
|
| 69 | 69 | // Construct data array |
| 70 | - $sensei_email_data = apply_filters( 'sensei_email_data', array( |
|
| 70 | + $sensei_email_data = apply_filters('sensei_email_data', array( |
|
| 71 | 71 | 'template' => $this->template, |
| 72 | 72 | 'heading' => $this->heading, |
| 73 | 73 | 'teacher_id' => $teacher_id, |
| 74 | 74 | 'course_id' => $course_id, |
| 75 | 75 | 'course_name' => $course->post_title, |
| 76 | 76 | 'course_edit_link' => $course_edit_link, |
| 77 | - ), $this->template ); |
|
| 77 | + ), $this->template); |
|
| 78 | 78 | |
| 79 | 79 | // Send mail |
| 80 | - Sensei()->emails->send( $this->recipient, $this->subject, Sensei()->emails->get_content( $this->template ) ); |
|
| 80 | + Sensei()->emails->send($this->recipient, $this->subject, Sensei()->emails->get_content($this->template)); |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | \ No newline at end of file |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + exit; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Sensei Analysis User Profile List Table Class |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $teacher_id = get_post_field( 'post_author', $lesson_id, 'raw' ); |
| 52 | 52 | $this->teacher = new WP_User( $teacher_id ); |
| 53 | 53 | |
| 54 | - // Construct data array |
|
| 54 | + // Construct data array |
|
| 55 | 55 | $sensei_email_data = apply_filters( 'sensei_email_data', array( |
| 56 | 56 | 'template' => $this->template, |
| 57 | 57 | 'heading' => $this->heading, |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $this->recipient = stripslashes( $this->teacher->user_email ); |
| 66 | 66 | |
| 67 | 67 | // Send mail |
| 68 | - Sensei()->emails->send( $this->recipient, $this->subject, Sensei()->emails->get_content( $this->template ) ); |
|
| 68 | + Sensei()->emails->send( $this->recipient, $this->subject, Sensei()->emails->get_content( $this->template ) ); |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 3 | +if ( ! defined('ABSPATH')) exit; // Exit if accessed directly |
|
| 4 | 4 | |
| 5 | -if ( ! class_exists( 'WooThemes_Sensei_Email_Teacher_Completed_Lesson' ) ) : |
|
| 5 | +if ( ! class_exists('WooThemes_Sensei_Email_Teacher_Completed_Lesson')) : |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * Teacher Completed Lesson |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | function __construct() { |
| 33 | 33 | $this->template = 'teacher-completed-lesson'; |
| 34 | - $this->subject = apply_filters( 'sensei_email_subject', sprintf( __( '[%1$s] Your student has completed a lesson', 'woothemes-sensei' ), get_bloginfo( 'name' ) ), $this->template ); |
|
| 35 | - $this->heading = apply_filters( 'sensei_email_heading', __( 'Your student has completed a lesson', 'woothemes-sensei' ), $this->template ); |
|
| 34 | + $this->subject = apply_filters('sensei_email_subject', sprintf(__('[%1$s] Your student has completed a lesson', 'woothemes-sensei'), get_bloginfo('name')), $this->template); |
|
| 35 | + $this->heading = apply_filters('sensei_email_heading', __('Your student has completed a lesson', 'woothemes-sensei'), $this->template); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -41,31 +41,31 @@ discard block |
||
| 41 | 41 | * @access public |
| 42 | 42 | * @return void |
| 43 | 43 | */ |
| 44 | - function trigger( $learner_id = 0, $lesson_id = 0 ) { |
|
| 44 | + function trigger($learner_id = 0, $lesson_id = 0) { |
|
| 45 | 45 | global $sensei_email_data; |
| 46 | 46 | |
| 47 | 47 | // Get learner user object |
| 48 | - $this->learner = new WP_User( $learner_id ); |
|
| 48 | + $this->learner = new WP_User($learner_id); |
|
| 49 | 49 | |
| 50 | 50 | // Get teacher ID and user object |
| 51 | - $teacher_id = get_post_field( 'post_author', $lesson_id, 'raw' ); |
|
| 52 | - $this->teacher = new WP_User( $teacher_id ); |
|
| 51 | + $teacher_id = get_post_field('post_author', $lesson_id, 'raw'); |
|
| 52 | + $this->teacher = new WP_User($teacher_id); |
|
| 53 | 53 | |
| 54 | 54 | // Construct data array |
| 55 | - $sensei_email_data = apply_filters( 'sensei_email_data', array( |
|
| 55 | + $sensei_email_data = apply_filters('sensei_email_data', array( |
|
| 56 | 56 | 'template' => $this->template, |
| 57 | 57 | 'heading' => $this->heading, |
| 58 | 58 | 'teacher_id' => $teacher_id, |
| 59 | 59 | 'learner_id' => $learner_id, |
| 60 | 60 | 'learner_name' => $this->learner->display_name, |
| 61 | 61 | 'lesson_id' => $lesson_id, |
| 62 | - ), $this->template ); |
|
| 62 | + ), $this->template); |
|
| 63 | 63 | |
| 64 | 64 | // Set recipient (teacher) |
| 65 | - $this->recipient = stripslashes( $this->teacher->user_email ); |
|
| 65 | + $this->recipient = stripslashes($this->teacher->user_email); |
|
| 66 | 66 | |
| 67 | 67 | // Send mail |
| 68 | - Sensei()->emails->send( $this->recipient, $this->subject, Sensei()->emails->get_content( $this->template ) ); |
|
| 68 | + Sensei()->emails->send($this->recipient, $this->subject, Sensei()->emails->get_content($this->template)); |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + exit; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Sensei Analysis User Profile List Table Class |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 3 | +if ( ! defined('ABSPATH')) exit; // Exit if accessed directly |
|
| 4 | 4 | |
| 5 | -if ( ! class_exists( 'WooThemes_Sensei_Email_Learner_Graded_Quiz' ) ) : |
|
| 5 | +if ( ! class_exists('WooThemes_Sensei_Email_Learner_Graded_Quiz')) : |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * Learner Graded Quiz |
@@ -30,8 +30,8 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | function __construct() { |
| 32 | 32 | $this->template = 'learner-graded-quiz'; |
| 33 | - $this->subject = apply_filters( 'sensei_email_subject', sprintf( __( '[%1$s] Your quiz has been graded', 'woothemes-sensei' ), get_bloginfo( 'name' ) ), $this->template ); |
|
| 34 | - $this->heading = apply_filters( 'sensei_email_heading', __( 'Your quiz has been graded', 'woothemes-sensei' ), $this->template ); |
|
| 33 | + $this->subject = apply_filters('sensei_email_subject', sprintf(__('[%1$s] Your quiz has been graded', 'woothemes-sensei'), get_bloginfo('name')), $this->template); |
|
| 34 | + $this->heading = apply_filters('sensei_email_heading', __('Your quiz has been graded', 'woothemes-sensei'), $this->template); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -40,47 +40,47 @@ discard block |
||
| 40 | 40 | * @access public |
| 41 | 41 | * @return void |
| 42 | 42 | */ |
| 43 | - function trigger( $user_id = 0, $quiz_id = 0, $grade = 0, $passmark = 0 ) { |
|
| 43 | + function trigger($user_id = 0, $quiz_id = 0, $grade = 0, $passmark = 0) { |
|
| 44 | 44 | global $sensei_email_data; |
| 45 | 45 | |
| 46 | 46 | // Get learner user object |
| 47 | - $this->user = new WP_User( $user_id ); |
|
| 47 | + $this->user = new WP_User($user_id); |
|
| 48 | 48 | |
| 49 | 49 | // Get passed flag |
| 50 | - $passed = __( 'failed', 'woothemes-sensei' ); |
|
| 51 | - if( $grade >= $passmark ) { |
|
| 52 | - $passed = __( 'passed', 'woothemes-sensei' ); |
|
| 50 | + $passed = __('failed', 'woothemes-sensei'); |
|
| 51 | + if ($grade >= $passmark) { |
|
| 52 | + $passed = __('passed', 'woothemes-sensei'); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | // Get grade tye (auto/manual) |
| 56 | - $grade_type = get_post_meta( $quiz_id, '_quiz_grade_type', true ); |
|
| 56 | + $grade_type = get_post_meta($quiz_id, '_quiz_grade_type', true); |
|
| 57 | 57 | |
| 58 | - if( 'auto' == $grade_type ) { |
|
| 59 | - $this->subject = apply_filters( 'sensei_email_subject', sprintf( __( '[%1$s] You have completed a quiz', 'woothemes-sensei' ), get_bloginfo( 'name' ) ), $this->template ); |
|
| 60 | - $this->heading = apply_filters( 'sensei_email_heading', __( 'You have completed a quiz', 'woothemes-sensei' ), $this->template ); |
|
| 58 | + if ('auto' == $grade_type) { |
|
| 59 | + $this->subject = apply_filters('sensei_email_subject', sprintf(__('[%1$s] You have completed a quiz', 'woothemes-sensei'), get_bloginfo('name')), $this->template); |
|
| 60 | + $this->heading = apply_filters('sensei_email_heading', __('You have completed a quiz', 'woothemes-sensei'), $this->template); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - $lesson_id = get_post_meta( $quiz_id, '_quiz_lesson', true ); |
|
| 63 | + $lesson_id = get_post_meta($quiz_id, '_quiz_lesson', true); |
|
| 64 | 64 | |
| 65 | 65 | // Construct data array |
| 66 | - $sensei_email_data = apply_filters( 'sensei_email_data', array( |
|
| 66 | + $sensei_email_data = apply_filters('sensei_email_data', array( |
|
| 67 | 67 | 'template' => $this->template, |
| 68 | 68 | 'heading' => $this->heading, |
| 69 | 69 | 'user_id' => $user_id, |
| 70 | - 'user_name' => stripslashes( $this->user->display_name ), |
|
| 70 | + 'user_name' => stripslashes($this->user->display_name), |
|
| 71 | 71 | 'lesson_id' => $lesson_id, |
| 72 | 72 | 'quiz_id' => $quiz_id, |
| 73 | 73 | 'grade' => $grade, |
| 74 | 74 | 'passmark' => $passmark, |
| 75 | 75 | 'passed' => $passed, |
| 76 | 76 | 'grade_type' => $grade_type, |
| 77 | - ), $this->template ); |
|
| 77 | + ), $this->template); |
|
| 78 | 78 | |
| 79 | 79 | // Set recipient (learner) |
| 80 | - $this->recipient = stripslashes( $this->user->user_email ); |
|
| 80 | + $this->recipient = stripslashes($this->user->user_email); |
|
| 81 | 81 | |
| 82 | 82 | // Send mail |
| 83 | - Sensei()->emails->send( $this->recipient, $this->subject, Sensei()->emails->get_content( $this->template ) ); |
|
| 83 | + Sensei()->emails->send($this->recipient, $this->subject, Sensei()->emails->get_content($this->template)); |
|
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + exit; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Sensei Analysis User Profile List Table Class |
@@ -48,8 +48,8 @@ |
||
| 48 | 48 | $this->learner = new WP_User( $learner_id ); |
| 49 | 49 | |
| 50 | 50 | // Get teacher ID and user object |
| 51 | - $lesson_id = get_post_meta( $quiz_id, '_quiz_lesson', true ); |
|
| 52 | - $course_id = get_post_meta( $lesson_id, '_lesson_course', true ); |
|
| 51 | + $lesson_id = get_post_meta( $quiz_id, '_quiz_lesson', true ); |
|
| 52 | + $course_id = get_post_meta( $lesson_id, '_lesson_course', true ); |
|
| 53 | 53 | $teacher_id = get_post_field( 'post_author', $course_id, 'raw' ); |
| 54 | 54 | $this->teacher = new WP_User( $teacher_id ); |
| 55 | 55 | |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 3 | +if ( ! defined('ABSPATH')) exit; // Exit if accessed directly |
|
| 4 | 4 | |
| 5 | -if ( ! class_exists( 'WooThemes_Sensei_Email_Teacher_Quiz_Submitted' ) ) : |
|
| 5 | +if ( ! class_exists('WooThemes_Sensei_Email_Teacher_Quiz_Submitted')) : |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * Teacher Quiz Submitted |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | function __construct() { |
| 33 | 33 | $this->template = 'teacher-quiz-submitted'; |
| 34 | - $this->subject = apply_filters( 'sensei_email_subject', sprintf( __( '[%1$s] Your student has submitted a quiz for grading', 'woothemes-sensei' ), get_bloginfo( 'name' ) ), $this->template ); |
|
| 35 | - $this->heading = apply_filters( 'sensei_email_heading', __( 'Your student has submitted a quiz for grading', 'woothemes-sensei' ), $this->template ); |
|
| 34 | + $this->subject = apply_filters('sensei_email_subject', sprintf(__('[%1$s] Your student has submitted a quiz for grading', 'woothemes-sensei'), get_bloginfo('name')), $this->template); |
|
| 35 | + $this->heading = apply_filters('sensei_email_heading', __('Your student has submitted a quiz for grading', 'woothemes-sensei'), $this->template); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -41,20 +41,20 @@ discard block |
||
| 41 | 41 | * @access public |
| 42 | 42 | * @return void |
| 43 | 43 | */ |
| 44 | - function trigger( $learner_id = 0, $quiz_id = 0 ) { |
|
| 44 | + function trigger($learner_id = 0, $quiz_id = 0) { |
|
| 45 | 45 | global $sensei_email_data; |
| 46 | 46 | |
| 47 | 47 | // Get learner user object |
| 48 | - $this->learner = new WP_User( $learner_id ); |
|
| 48 | + $this->learner = new WP_User($learner_id); |
|
| 49 | 49 | |
| 50 | 50 | // Get teacher ID and user object |
| 51 | - $lesson_id = get_post_meta( $quiz_id, '_quiz_lesson', true ); |
|
| 52 | - $course_id = get_post_meta( $lesson_id, '_lesson_course', true ); |
|
| 53 | - $teacher_id = get_post_field( 'post_author', $course_id, 'raw' ); |
|
| 54 | - $this->teacher = new WP_User( $teacher_id ); |
|
| 51 | + $lesson_id = get_post_meta($quiz_id, '_quiz_lesson', true); |
|
| 52 | + $course_id = get_post_meta($lesson_id, '_lesson_course', true); |
|
| 53 | + $teacher_id = get_post_field('post_author', $course_id, 'raw'); |
|
| 54 | + $this->teacher = new WP_User($teacher_id); |
|
| 55 | 55 | |
| 56 | 56 | // Construct data array |
| 57 | - $sensei_email_data = apply_filters( 'sensei_email_data', array( |
|
| 57 | + $sensei_email_data = apply_filters('sensei_email_data', array( |
|
| 58 | 58 | 'template' => $this->template, |
| 59 | 59 | 'heading' => $this->heading, |
| 60 | 60 | 'teacher_id' => $teacher_id, |
@@ -62,13 +62,13 @@ discard block |
||
| 62 | 62 | 'learner_name' => $this->learner->display_name, |
| 63 | 63 | 'quiz_id' => $quiz_id, |
| 64 | 64 | 'lesson_id' => $lesson_id, |
| 65 | - ), $this->template ); |
|
| 65 | + ), $this->template); |
|
| 66 | 66 | |
| 67 | 67 | // Set recipient (teacher) |
| 68 | - $this->recipient = stripslashes( $this->teacher->user_email ); |
|
| 68 | + $this->recipient = stripslashes($this->teacher->user_email); |
|
| 69 | 69 | |
| 70 | 70 | // Send mail |
| 71 | - Sensei()->emails->send( $this->recipient, $this->subject, Sensei()->emails->get_content( $this->template ) ); |
|
| 71 | + Sensei()->emails->send($this->recipient, $this->subject, Sensei()->emails->get_content($this->template)); |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + exit; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Sensei Analysis User Profile List Table Class |
@@ -57,16 +57,16 @@ |
||
| 57 | 57 | $content_id = get_post_meta( $message_id, '_post', true ); |
| 58 | 58 | $content_title = get_the_title( $content_id ); |
| 59 | 59 | |
| 60 | - // setup the post type parameter |
|
| 61 | - $content_type = get_post_type( $content_id ); |
|
| 62 | - if( !$content_type ){ |
|
| 63 | - $content_type =''; |
|
| 64 | - } |
|
| 60 | + // setup the post type parameter |
|
| 61 | + $content_type = get_post_type( $content_id ); |
|
| 62 | + if( !$content_type ){ |
|
| 63 | + $content_type =''; |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | 66 | // Construct data array |
| 67 | 67 | $sensei_email_data = apply_filters( 'sensei_email_data', array( |
| 68 | 68 | 'template' => $this->template, |
| 69 | - $content_type.'_id' => $content_id, |
|
| 69 | + $content_type.'_id' => $content_id, |
|
| 70 | 70 | 'heading' => $this->heading, |
| 71 | 71 | 'teacher_id' => $this->teacher->ID, |
| 72 | 72 | 'learner_id' => $this->learner->ID, |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 3 | +if ( ! defined('ABSPATH')) exit; // Exit if accessed directly |
|
| 4 | 4 | |
| 5 | -if ( ! class_exists( 'WooThemes_Sensei_Email_Teacher_New_Message' ) ) : |
|
| 5 | +if ( ! class_exists('WooThemes_Sensei_Email_Teacher_New_Message')) : |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * Teacher New Message |
@@ -32,8 +32,8 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | function __construct() { |
| 34 | 34 | $this->template = 'teacher-new-message'; |
| 35 | - $this->subject = apply_filters( 'sensei_email_subject', sprintf( __( '[%1$s] You have received a new private message', 'woothemes-sensei' ), get_bloginfo( 'name' ) ), $this->template ); |
|
| 36 | - $this->heading = apply_filters( 'sensei_email_heading', __( 'Your student has sent you a private message', 'woothemes-sensei' ), $this->template ); |
|
| 35 | + $this->subject = apply_filters('sensei_email_subject', sprintf(__('[%1$s] You have received a new private message', 'woothemes-sensei'), get_bloginfo('name')), $this->template); |
|
| 36 | + $this->heading = apply_filters('sensei_email_heading', __('Your student has sent you a private message', 'woothemes-sensei'), $this->template); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -42,29 +42,29 @@ discard block |
||
| 42 | 42 | * @access public |
| 43 | 43 | * @return void |
| 44 | 44 | */ |
| 45 | - function trigger( $message_id = 0 ) { |
|
| 45 | + function trigger($message_id = 0) { |
|
| 46 | 46 | global $sensei_email_data; |
| 47 | 47 | |
| 48 | - $this->message = get_post( $message_id ); |
|
| 48 | + $this->message = get_post($message_id); |
|
| 49 | 49 | |
| 50 | - $learner_username = get_post_meta( $message_id, '_sender', true ); |
|
| 51 | - $this->learner = get_user_by( 'login', $learner_username ); |
|
| 50 | + $learner_username = get_post_meta($message_id, '_sender', true); |
|
| 51 | + $this->learner = get_user_by('login', $learner_username); |
|
| 52 | 52 | |
| 53 | - $teacher_username = get_post_meta( $message_id, '_receiver', true ); |
|
| 54 | - $this->teacher = get_user_by( 'login', $teacher_username ); |
|
| 53 | + $teacher_username = get_post_meta($message_id, '_receiver', true); |
|
| 54 | + $this->teacher = get_user_by('login', $teacher_username); |
|
| 55 | 55 | |
| 56 | - $content_type = get_post_meta( $message_id, '_posttype', true ); |
|
| 57 | - $content_id = get_post_meta( $message_id, '_post', true ); |
|
| 58 | - $content_title = get_the_title( $content_id ); |
|
| 56 | + $content_type = get_post_meta($message_id, '_posttype', true); |
|
| 57 | + $content_id = get_post_meta($message_id, '_post', true); |
|
| 58 | + $content_title = get_the_title($content_id); |
|
| 59 | 59 | |
| 60 | 60 | // setup the post type parameter |
| 61 | - $content_type = get_post_type( $content_id ); |
|
| 62 | - if( !$content_type ){ |
|
| 63 | - $content_type =''; |
|
| 61 | + $content_type = get_post_type($content_id); |
|
| 62 | + if ( ! $content_type) { |
|
| 63 | + $content_type = ''; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | // Construct data array |
| 67 | - $sensei_email_data = apply_filters( 'sensei_email_data', array( |
|
| 67 | + $sensei_email_data = apply_filters('sensei_email_data', array( |
|
| 68 | 68 | 'template' => $this->template, |
| 69 | 69 | $content_type.'_id' => $content_id, |
| 70 | 70 | 'heading' => $this->heading, |
@@ -75,15 +75,15 @@ discard block |
||
| 75 | 75 | 'message' => $this->message->post_content, |
| 76 | 76 | 'content_title' => $content_title, |
| 77 | 77 | 'content_type' => $content_type, |
| 78 | - ), $this->template ); |
|
| 78 | + ), $this->template); |
|
| 79 | 79 | |
| 80 | 80 | // Set recipient (teacher) |
| 81 | - $this->recipient = stripslashes( $this->teacher->user_email ); |
|
| 81 | + $this->recipient = stripslashes($this->teacher->user_email); |
|
| 82 | 82 | |
| 83 | 83 | // Send mail |
| 84 | - Sensei()->emails->send( $this->recipient, $this->subject, Sensei()->emails->get_content( $this->template ) ); |
|
| 84 | + Sensei()->emails->send($this->recipient, $this->subject, Sensei()->emails->get_content($this->template)); |
|
| 85 | 85 | |
| 86 | - wp_safe_redirect( esc_url_raw( add_query_arg( array( 'send' => 'complete' ) ) ) ); |
|
| 86 | + wp_safe_redirect(esc_url_raw(add_query_arg(array('send' => 'complete')))); |
|
| 87 | 87 | exit; |
| 88 | 88 | } |
| 89 | 89 | } |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + exit; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Sensei Analysis User Profile List Table Class |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 3 | +if ( ! defined('ABSPATH')) exit; // Exit if accessed directly |
|
| 4 | 4 | |
| 5 | -if ( ! class_exists( 'WooThemes_Sensei_Email_Teacher_Started_Course' ) ) : |
|
| 5 | +if ( ! class_exists('WooThemes_Sensei_Email_Teacher_Started_Course')) : |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * Teacher Started Course |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | function __construct() { |
| 33 | 33 | $this->template = 'teacher-started-course'; |
| 34 | - $this->subject = apply_filters( 'sensei_email_subject', sprintf( __( '[%1$s] Your student has started a course', 'woothemes-sensei' ), get_bloginfo( 'name' ) ), $this->template ); |
|
| 35 | - $this->heading = apply_filters( 'sensei_email_heading', __( 'Your student has started a course', 'woothemes-sensei' ), $this->template ); |
|
| 34 | + $this->subject = apply_filters('sensei_email_subject', sprintf(__('[%1$s] Your student has started a course', 'woothemes-sensei'), get_bloginfo('name')), $this->template); |
|
| 35 | + $this->heading = apply_filters('sensei_email_heading', __('Your student has started a course', 'woothemes-sensei'), $this->template); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -41,31 +41,31 @@ discard block |
||
| 41 | 41 | * @access public |
| 42 | 42 | * @return void |
| 43 | 43 | */ |
| 44 | - function trigger( $learner_id = 0, $course_id = 0 ) { |
|
| 44 | + function trigger($learner_id = 0, $course_id = 0) { |
|
| 45 | 45 | global $sensei_email_data; |
| 46 | 46 | |
| 47 | 47 | // Get learner user object |
| 48 | - $this->learner = new WP_User( $learner_id ); |
|
| 48 | + $this->learner = new WP_User($learner_id); |
|
| 49 | 49 | |
| 50 | 50 | // Get teacher ID and user object |
| 51 | - $teacher_id = get_post_field( 'post_author', $course_id, 'raw' ); |
|
| 52 | - $this->teacher = new WP_User( $teacher_id ); |
|
| 51 | + $teacher_id = get_post_field('post_author', $course_id, 'raw'); |
|
| 52 | + $this->teacher = new WP_User($teacher_id); |
|
| 53 | 53 | |
| 54 | 54 | // Construct data array |
| 55 | - $sensei_email_data = apply_filters( 'sensei_email_data', array( |
|
| 55 | + $sensei_email_data = apply_filters('sensei_email_data', array( |
|
| 56 | 56 | 'template' => $this->template, |
| 57 | 57 | 'heading' => $this->heading, |
| 58 | 58 | 'teacher_id' => $teacher_id, |
| 59 | 59 | 'learner_id' => $learner_id, |
| 60 | 60 | 'learner_name' => $this->learner->display_name, |
| 61 | 61 | 'course_id' => $course_id, |
| 62 | - ), $this->template ); |
|
| 62 | + ), $this->template); |
|
| 63 | 63 | |
| 64 | 64 | // Set recipient (learner) |
| 65 | - $this->recipient = stripslashes( $this->teacher->user_email ); |
|
| 65 | + $this->recipient = stripslashes($this->teacher->user_email); |
|
| 66 | 66 | |
| 67 | 67 | // Send mail |
| 68 | - Sensei()->emails->send( $this->recipient, $this->subject, Sensei()->emails->get_content( $this->template ) ); |
|
| 68 | + Sensei()->emails->send($this->recipient, $this->subject, Sensei()->emails->get_content($this->template)); |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + exit; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Sensei Analysis User Profile List Table Class |
@@ -64,16 +64,16 @@ |
||
| 64 | 64 | |
| 65 | 65 | $comment_link = get_comment_link( $comment ); |
| 66 | 66 | |
| 67 | - // setup the post type parameter |
|
| 68 | - $content_type = get_post_type( $content_id ); |
|
| 69 | - if( !$content_type ){ |
|
| 70 | - $content_type =''; |
|
| 71 | - } |
|
| 72 | - |
|
| 73 | - // Construct data array |
|
| 74 | - $sensei_email_data = apply_filters( 'sensei_email_data', array( |
|
| 75 | - 'template' => $this->template, |
|
| 76 | - $content_type.'_id' => $content_id, |
|
| 67 | + // setup the post type parameter |
|
| 68 | + $content_type = get_post_type( $content_id ); |
|
| 69 | + if( !$content_type ){ |
|
| 70 | + $content_type =''; |
|
| 71 | + } |
|
| 72 | + |
|
| 73 | + // Construct data array |
|
| 74 | + $sensei_email_data = apply_filters( 'sensei_email_data', array( |
|
| 75 | + 'template' => $this->template, |
|
| 76 | + $content_type.'_id' => $content_id, |
|
| 77 | 77 | 'heading' => $this->heading, |
| 78 | 78 | 'commenter_name' => $this->commenter->display_name, |
| 79 | 79 | 'message' => $this->comment->comment_content, |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 3 | +if ( ! defined('ABSPATH')) exit; // Exit if accessed directly |
|
| 4 | 4 | |
| 5 | -if ( ! class_exists( 'WooThemes_Sensei_Email_New_Message_Reply' ) ) : |
|
| 5 | +if ( ! class_exists('WooThemes_Sensei_Email_New_Message_Reply')) : |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * Teacher New Message |
@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | function __construct() { |
| 36 | 36 | $this->template = 'new-message-reply'; |
| 37 | - $this->subject = apply_filters( 'sensei_email_subject', sprintf( __( '[%1$s] You have a new message', 'woothemes-sensei' ), get_bloginfo( 'name' ) ), $this->template ); |
|
| 38 | - $this->heading = apply_filters( 'sensei_email_heading', __( 'You have received a reply to your private message', 'woothemes-sensei' ), $this->template ); |
|
| 37 | + $this->subject = apply_filters('sensei_email_subject', sprintf(__('[%1$s] You have a new message', 'woothemes-sensei'), get_bloginfo('name')), $this->template); |
|
| 38 | + $this->heading = apply_filters('sensei_email_heading', __('You have received a reply to your private message', 'woothemes-sensei'), $this->template); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -44,34 +44,34 @@ discard block |
||
| 44 | 44 | * @access public |
| 45 | 45 | * @return void |
| 46 | 46 | */ |
| 47 | - function trigger( $comment, $message ) { |
|
| 47 | + function trigger($comment, $message) { |
|
| 48 | 48 | global $sensei_email_data; |
| 49 | 49 | |
| 50 | 50 | $this->comment = $comment; |
| 51 | 51 | $this->message = $message; |
| 52 | 52 | |
| 53 | - $this->commenter = get_userdata( $comment->user_id ); |
|
| 53 | + $this->commenter = get_userdata($comment->user_id); |
|
| 54 | 54 | |
| 55 | - $original_sender = get_post_meta( $this->message->ID, '_sender', true ); |
|
| 56 | - $this->original_sender = get_user_by( 'login', $original_sender ); |
|
| 55 | + $original_sender = get_post_meta($this->message->ID, '_sender', true); |
|
| 56 | + $this->original_sender = get_user_by('login', $original_sender); |
|
| 57 | 57 | |
| 58 | - $original_receiver = get_post_meta( $this->message->ID, '_receiver', true ); |
|
| 59 | - $this->original_receiver = get_user_by( 'login', $original_receiver ); |
|
| 58 | + $original_receiver = get_post_meta($this->message->ID, '_receiver', true); |
|
| 59 | + $this->original_receiver = get_user_by('login', $original_receiver); |
|
| 60 | 60 | |
| 61 | - $content_type = get_post_meta( $this->message->ID, '_posttype', true ); |
|
| 62 | - $content_id = get_post_meta( $this->message->ID, '_post', true ); |
|
| 63 | - $content_title = get_the_title( $content_id ); |
|
| 61 | + $content_type = get_post_meta($this->message->ID, '_posttype', true); |
|
| 62 | + $content_id = get_post_meta($this->message->ID, '_post', true); |
|
| 63 | + $content_title = get_the_title($content_id); |
|
| 64 | 64 | |
| 65 | - $comment_link = get_comment_link( $comment ); |
|
| 65 | + $comment_link = get_comment_link($comment); |
|
| 66 | 66 | |
| 67 | 67 | // setup the post type parameter |
| 68 | - $content_type = get_post_type( $content_id ); |
|
| 69 | - if( !$content_type ){ |
|
| 70 | - $content_type =''; |
|
| 68 | + $content_type = get_post_type($content_id); |
|
| 69 | + if ( ! $content_type) { |
|
| 70 | + $content_type = ''; |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | // Construct data array |
| 74 | - $sensei_email_data = apply_filters( 'sensei_email_data', array( |
|
| 74 | + $sensei_email_data = apply_filters('sensei_email_data', array( |
|
| 75 | 75 | 'template' => $this->template, |
| 76 | 76 | $content_type.'_id' => $content_id, |
| 77 | 77 | 'heading' => $this->heading, |
@@ -80,17 +80,17 @@ discard block |
||
| 80 | 80 | 'comment_link' => $comment_link, |
| 81 | 81 | 'content_title' => $content_title, |
| 82 | 82 | 'content_type' => $content_type, |
| 83 | - ), $this->template ); |
|
| 83 | + ), $this->template); |
|
| 84 | 84 | |
| 85 | 85 | // Set recipient |
| 86 | - if( $this->commenter->user_login == $original_sender ) { |
|
| 87 | - $this->recipient = stripslashes( $this->original_receiver->user_email ); |
|
| 86 | + if ($this->commenter->user_login == $original_sender) { |
|
| 87 | + $this->recipient = stripslashes($this->original_receiver->user_email); |
|
| 88 | 88 | } else { |
| 89 | - $this->recipient = stripslashes( $this->original_sender->user_email ); |
|
| 89 | + $this->recipient = stripslashes($this->original_sender->user_email); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | // Send mail |
| 93 | - Sensei()->emails->send( $this->recipient, $this->subject, Sensei()->emails->get_content( $this->template ) ); |
|
| 93 | + Sensei()->emails->send($this->recipient, $this->subject, Sensei()->emails->get_content($this->template)); |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | + exit; |
|
| 4 | +} |
|
| 5 | +// Exit if accessed directly |
|
| 3 | 6 | |
| 4 | 7 | /** |
| 5 | 8 | * Sensei Analysis User Profile List Table Class |
@@ -25,45 +25,45 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * Hook in tabs. |
| 28 | - * @since 1.8.0 |
|
| 28 | + * @since 1.8.0 |
|
| 29 | 29 | */ |
| 30 | 30 | public function __construct() { |
| 31 | 31 | |
| 32 | - add_action( 'admin_menu', array( $this, 'admin_menus') ); |
|
| 32 | + add_action( 'admin_menu', array( $this, 'admin_menus') ); |
|
| 33 | 33 | add_action( 'admin_head', array( $this, 'admin_head' ) ); |
| 34 | 34 | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Sends user to the welcome page on first activation. |
|
| 39 | - * |
|
| 40 | - * Hooked into activated_plugin |
|
| 41 | - * @since 1.8.0 |
|
| 42 | - */ |
|
| 43 | - public static function redirect( $plugin ) { |
|
| 37 | + /** |
|
| 38 | + * Sends user to the welcome page on first activation. |
|
| 39 | + * |
|
| 40 | + * Hooked into activated_plugin |
|
| 41 | + * @since 1.8.0 |
|
| 42 | + */ |
|
| 43 | + public static function redirect( $plugin ) { |
|
| 44 | 44 | |
| 45 | - // Bail if activating from network, or bulk, or within an iFrame |
|
| 46 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) || defined( 'IFRAME_REQUEST' ) ) { |
|
| 45 | + // Bail if activating from network, or bulk, or within an iFrame |
|
| 46 | + if ( is_network_admin() || isset( $_GET['activate-multi'] ) || defined( 'IFRAME_REQUEST' ) ) { |
|
| 47 | 47 | |
| 48 | - return; |
|
| 48 | + return; |
|
| 49 | 49 | |
| 50 | - } |
|
| 51 | - // don't run for upgrades and for pages already on the welcome screen |
|
| 52 | - if ( ( isset( $_GET['action'] ) && 'upgrade-plugin' == $_GET['action'] ) |
|
| 53 | - || ( ! empty( $_GET['page'] ) && $_GET['page'] === 'sensei-welcome' ) ) { |
|
| 50 | + } |
|
| 51 | + // don't run for upgrades and for pages already on the welcome screen |
|
| 52 | + if ( ( isset( $_GET['action'] ) && 'upgrade-plugin' == $_GET['action'] ) |
|
| 53 | + || ( ! empty( $_GET['page'] ) && $_GET['page'] === 'sensei-welcome' ) ) { |
|
| 54 | 54 | |
| 55 | - return; |
|
| 55 | + return; |
|
| 56 | 56 | |
| 57 | - } |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | - wp_redirect( admin_url( 'index.php?page=sensei-welcome' ) ); |
|
| 60 | - exit; |
|
| 61 | - } |
|
| 59 | + wp_redirect( admin_url( 'index.php?page=sensei-welcome' ) ); |
|
| 60 | + exit; |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | 64 | * Add admin menus/screens. |
| 65 | - * |
|
| 66 | - * @since 1.8.0 |
|
| 65 | + * |
|
| 66 | + * @since 1.8.0 |
|
| 67 | 67 | */ |
| 68 | 68 | public function admin_menus() { |
| 69 | 69 | |
@@ -73,17 +73,17 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | $welcome_page_name = __( 'Sensei Activation', 'woothemes-sensei' ); |
| 75 | 75 | $welcome_page_title = __( 'Welcome to Sensei', 'woothemes-sensei' ); |
| 76 | - add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sensei-welcome', array( $this, 'welcome_screen' ) ); |
|
| 76 | + add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sensei-welcome', array( $this, 'welcome_screen' ) ); |
|
| 77 | 77 | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - /** |
|
| 81 | - * Output the Welcome screen. |
|
| 82 | - * |
|
| 83 | - * @since 1.8.0 |
|
| 84 | - */ |
|
| 85 | - public function welcome_screen() { |
|
| 86 | - ?> |
|
| 80 | + /** |
|
| 81 | + * Output the Welcome screen. |
|
| 82 | + * |
|
| 83 | + * @since 1.8.0 |
|
| 84 | + */ |
|
| 85 | + public function welcome_screen() { |
|
| 86 | + ?> |
|
| 87 | 87 | <div class="wrap about-wrap"> |
| 88 | 88 | |
| 89 | 89 | <?php $this->intro(); ?> |
@@ -136,13 +136,13 @@ discard block |
||
| 136 | 136 | </div> |
| 137 | 137 | </div> |
| 138 | 138 | <?php |
| 139 | - } |
|
| 139 | + } |
|
| 140 | 140 | |
| 141 | 141 | /** |
| 142 | 142 | * Add styles just for this page, and remove dashboard page links. |
| 143 | 143 | */ |
| 144 | 144 | public function admin_head() { |
| 145 | - // remove the menu page so it is not visible in the admin side bar |
|
| 145 | + // remove the menu page so it is not visible in the admin side bar |
|
| 146 | 146 | remove_submenu_page( 'index.php', 'sensei-welcome' ); |
| 147 | 147 | ?> |
| 148 | 148 | <style type="text/css"> |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | |
| 267 | 267 | // Random tweet - must be kept to 102 chars to "fit" |
| 268 | 268 | $tweets = array( |
| 269 | - 'I\'ve just installed Sensei - A premium Learning Management plugin for #WordPress.' |
|
| 269 | + 'I\'ve just installed Sensei - A premium Learning Management plugin for #WordPress.' |
|
| 270 | 270 | ); |
| 271 | 271 | shuffle( $tweets ); |
| 272 | 272 | ?> |
@@ -288,11 +288,11 @@ discard block |
||
| 288 | 288 | |
| 289 | 289 | <div class="sensei-badge"> |
| 290 | 290 | <?php |
| 291 | - _e('Sensei by WooThemes','woothemes-sensei'); |
|
| 292 | - echo '<br />'; |
|
| 291 | + _e('Sensei by WooThemes','woothemes-sensei'); |
|
| 292 | + echo '<br />'; |
|
| 293 | 293 | |
| 294 | - printf( __( 'Version %s', 'woothemes-sensei' ), Sensei()->version ); |
|
| 295 | - ?> |
|
| 294 | + printf( __( 'Version %s', 'woothemes-sensei' ), Sensei()->version ); |
|
| 295 | + ?> |
|
| 296 | 296 | </div> |
| 297 | 297 | |
| 298 | 298 | <p class="sensei-actions"> |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | * @version 1.8.0 |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 15 | +if ( ! defined('ABSPATH')) { |
|
| 16 | 16 | exit; // Exit if accessed directly |
| 17 | 17 | } |
| 18 | 18 | |
@@ -29,8 +29,8 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function __construct() { |
| 31 | 31 | |
| 32 | - add_action( 'admin_menu', array( $this, 'admin_menus') ); |
|
| 33 | - add_action( 'admin_head', array( $this, 'admin_head' ) ); |
|
| 32 | + add_action('admin_menu', array($this, 'admin_menus')); |
|
| 33 | + add_action('admin_head', array($this, 'admin_head')); |
|
| 34 | 34 | |
| 35 | 35 | } |
| 36 | 36 | |
@@ -40,23 +40,23 @@ discard block |
||
| 40 | 40 | * Hooked into activated_plugin |
| 41 | 41 | * @since 1.8.0 |
| 42 | 42 | */ |
| 43 | - public static function redirect( $plugin ) { |
|
| 43 | + public static function redirect($plugin) { |
|
| 44 | 44 | |
| 45 | 45 | // Bail if activating from network, or bulk, or within an iFrame |
| 46 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) || defined( 'IFRAME_REQUEST' ) ) { |
|
| 46 | + if (is_network_admin() || isset($_GET['activate-multi']) || defined('IFRAME_REQUEST')) { |
|
| 47 | 47 | |
| 48 | 48 | return; |
| 49 | 49 | |
| 50 | 50 | } |
| 51 | 51 | // don't run for upgrades and for pages already on the welcome screen |
| 52 | - if ( ( isset( $_GET['action'] ) && 'upgrade-plugin' == $_GET['action'] ) |
|
| 53 | - || ( ! empty( $_GET['page'] ) && $_GET['page'] === 'sensei-welcome' ) ) { |
|
| 52 | + if ((isset($_GET['action']) && 'upgrade-plugin' == $_GET['action']) |
|
| 53 | + || ( ! empty($_GET['page']) && $_GET['page'] === 'sensei-welcome')) { |
|
| 54 | 54 | |
| 55 | 55 | return; |
| 56 | 56 | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - wp_redirect( admin_url( 'index.php?page=sensei-welcome' ) ); |
|
| 59 | + wp_redirect(admin_url('index.php?page=sensei-welcome')); |
|
| 60 | 60 | exit; |
| 61 | 61 | } |
| 62 | 62 | |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public function admin_menus() { |
| 69 | 69 | |
| 70 | - if ( ! isset( $_GET['page'] ) || 'sensei-welcome' != $_GET[ 'page' ] ) { |
|
| 70 | + if ( ! isset($_GET['page']) || 'sensei-welcome' != $_GET['page']) { |
|
| 71 | 71 | return; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - $welcome_page_name = __( 'Sensei Activation', 'woothemes-sensei' ); |
|
| 75 | - $welcome_page_title = __( 'Welcome to Sensei', 'woothemes-sensei' ); |
|
| 76 | - add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sensei-welcome', array( $this, 'welcome_screen' ) ); |
|
| 74 | + $welcome_page_name = __('Sensei Activation', 'woothemes-sensei'); |
|
| 75 | + $welcome_page_title = __('Welcome to Sensei', 'woothemes-sensei'); |
|
| 76 | + add_dashboard_page($welcome_page_title, $welcome_page_name, 'manage_options', 'sensei-welcome', array($this, 'welcome_screen')); |
|
| 77 | 77 | |
| 78 | 78 | } |
| 79 | 79 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | <hr /> |
| 133 | 133 | |
| 134 | 134 | <div class="return-to-dashboard"> |
| 135 | - <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'woothemes-sensei-settings' ), 'admin.php' ) ) ); ?>"><?php _e( 'Go to Sensei Settings', 'woothemes-sensei' ); ?></a> |
|
| 135 | + <a href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'woothemes-sensei-settings'), 'admin.php'))); ?>"><?php _e('Go to Sensei Settings', 'woothemes-sensei'); ?></a> |
|
| 136 | 136 | </div> |
| 137 | 137 | </div> |
| 138 | 138 | <?php |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public function admin_head() { |
| 145 | 145 | // remove the menu page so it is not visible in the admin side bar |
| 146 | - remove_submenu_page( 'index.php', 'sensei-welcome' ); |
|
| 146 | + remove_submenu_page('index.php', 'sensei-welcome'); |
|
| 147 | 147 | ?> |
| 148 | 148 | <style type="text/css"> |
| 149 | 149 | /*<![CDATA[*/ |
@@ -262,47 +262,47 @@ discard block |
||
| 262 | 262 | private function intro() { |
| 263 | 263 | |
| 264 | 264 | // Drop minor version if 0 |
| 265 | - $major_version = substr( Sensei()->version, 0, 3 ); |
|
| 265 | + $major_version = substr(Sensei()->version, 0, 3); |
|
| 266 | 266 | |
| 267 | 267 | // Random tweet - must be kept to 102 chars to "fit" |
| 268 | 268 | $tweets = array( |
| 269 | 269 | 'I\'ve just installed Sensei - A premium Learning Management plugin for #WordPress.' |
| 270 | 270 | ); |
| 271 | - shuffle( $tweets ); |
|
| 271 | + shuffle($tweets); |
|
| 272 | 272 | ?> |
| 273 | - <h1><?php printf( __( 'Welcome to Sensei %s', 'woothemes-sensei' ), $major_version ); ?></h1> |
|
| 273 | + <h1><?php printf(__('Welcome to Sensei %s', 'woothemes-sensei'), $major_version); ?></h1> |
|
| 274 | 274 | |
| 275 | 275 | <div class="about-text sensei-about-text"> |
| 276 | 276 | <?php |
| 277 | - if ( ! empty( $_GET['sensei-installed'] ) ) { |
|
| 278 | - $message = __( 'Thanks, all done!', 'woothemes-sensei' ); |
|
| 279 | - } elseif ( ! empty( $_GET['sensei-updated'] ) ) { |
|
| 280 | - $message = __( 'Thank you for updating to the latest version!', 'woothemes-sensei' ); |
|
| 277 | + if ( ! empty($_GET['sensei-installed'])) { |
|
| 278 | + $message = __('Thanks, all done!', 'woothemes-sensei'); |
|
| 279 | + } elseif ( ! empty($_GET['sensei-updated'])) { |
|
| 280 | + $message = __('Thank you for updating to the latest version!', 'woothemes-sensei'); |
|
| 281 | 281 | } else { |
| 282 | - $message = __( 'Thanks for installing!', 'woothemes-sensei' ); |
|
| 282 | + $message = __('Thanks for installing!', 'woothemes-sensei'); |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | - printf( __( '%s We hope you enjoy using Sensei %s.', 'woothemes-sensei' ), $message, $major_version ); |
|
| 285 | + printf(__('%s We hope you enjoy using Sensei %s.', 'woothemes-sensei'), $message, $major_version); |
|
| 286 | 286 | ?> |
| 287 | 287 | </div> |
| 288 | 288 | |
| 289 | 289 | <div class="sensei-badge"> |
| 290 | 290 | <?php |
| 291 | - _e('Sensei by WooThemes','woothemes-sensei'); |
|
| 291 | + _e('Sensei by WooThemes', 'woothemes-sensei'); |
|
| 292 | 292 | echo '<br />'; |
| 293 | 293 | |
| 294 | - printf( __( 'Version %s', 'woothemes-sensei' ), Sensei()->version ); |
|
| 294 | + printf(__('Version %s', 'woothemes-sensei'), Sensei()->version); |
|
| 295 | 295 | ?> |
| 296 | 296 | </div> |
| 297 | 297 | |
| 298 | 298 | <p class="sensei-actions"> |
| 299 | - <a href="<?php echo admin_url('admin.php?page=woothemes-sensei-settings'); ?>" class="button button-primary"><?php _e( 'Settings', 'woothemes-sensei' ); ?></a> |
|
| 300 | - <a href="<?php echo esc_url( apply_filters( 'sensei_docs_url', 'http://docs.woothemes.com/documentation/plugins/sensei/', 'woothemes-sensei' ) ); ?>" class="docs button button-primary"><?php _e( 'Docs', 'woothemes-sensei' ); ?></a> |
|
| 301 | - <a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.woothemes.com/products/sensei" data-text="<?php echo esc_attr( $tweets[0] ); ?>" data-via="WooThemes" data-size="large">Tweet</a> |
|
| 299 | + <a href="<?php echo admin_url('admin.php?page=woothemes-sensei-settings'); ?>" class="button button-primary"><?php _e('Settings', 'woothemes-sensei'); ?></a> |
|
| 300 | + <a href="<?php echo esc_url(apply_filters('sensei_docs_url', 'http://docs.woothemes.com/documentation/plugins/sensei/', 'woothemes-sensei')); ?>" class="docs button button-primary"><?php _e('Docs', 'woothemes-sensei'); ?></a> |
|
| 301 | + <a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.woothemes.com/products/sensei" data-text="<?php echo esc_attr($tweets[0]); ?>" data-via="WooThemes" data-size="large">Tweet</a> |
|
| 302 | 302 | <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> |
| 303 | 303 | </p> |
| 304 | 304 | |
| 305 | - <h2 > <?php _e( "What's New", 'woothemes-sensei' ); ?> </h2> |
|
| 305 | + <h2 > <?php _e("What's New", 'woothemes-sensei'); ?> </h2> |
|
| 306 | 306 | |
| 307 | 307 | <?php |
| 308 | 308 | } |