Changeset 1602
- Timestamp:
- 05/20/2015 05:57:13 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/jobs.wordpress.net/public_html/wp-content/plugins/jobswp/jobswp.php
r497 r1602 70 70 * Constructor 71 71 */ 72 function __construct() {72 protected function __construct() { 73 73 if ( class_exists( 'Walker_Jobs_Category' ) ) 74 74 self::$walker = new Walker_Jobs_Category; … … 83 83 * Invokes registration of custom post type, taxonomy, and statuses. 84 84 */ 85 function registrations() {85 public function registrations() { 86 86 $this->register_post_type(); 87 87 $this->register_post_status(); … … 93 93 * as any processing that needs to happen directly on 'init'. 94 94 */ 95 function init() {95 public function init() { 96 96 // Allow customization of the number of days until a job gets pruned. 97 97 // By default, it is 21 days. … … 129 129 * @return array The amended list of allowed tags 130 130 */ 131 function wp_kses_allowed_html( $allowedtags, $content ) {131 public function wp_kses_allowed_html( $allowedtags, $content ) { 132 132 // Add permissable tags 133 133 $allowedtags['ol'] = array(); … … 151 151 * @return array The amended list of classes to be added to 'body' tag 152 152 */ 153 function body_class( $classes ) {153 public function body_class( $classes ) { 154 154 $classes[] = 'jobswp'; 155 155 return $classes; … … 165 165 * @return array Amended associated array of column names and labels 166 166 */ 167 function posts_columns( $columns, $post_type ) {167 public function posts_columns( $columns, $post_type ) { 168 168 if ( 'job' !== $post_type ) { 169 169 return $columns; … … 180 180 * @param int $post_id The post ID 181 181 */ 182 function custom_posts_columns( $column_name, $post_id ) {182 public function custom_posts_columns( $column_name, $post_id ) { 183 183 switch ( $column_name ) { 184 184 case 'poster': … … 200 200 * Registers the custom post type. 201 201 */ 202 function register_post_type() {202 protected function register_post_type() { 203 203 $labels = array( 204 204 'name' => _x( 'Jobs', 'Post Type General Name', 'jobswp' ), … … 242 242 * Registers the custom post statuses. 243 243 */ 244 function register_post_status() {244 protected function register_post_status() { 245 245 // Status of 'closed' indicates a job that was unpublished from the site. 246 246 register_post_status( 'closed', array( … … 268 268 * Registers the custom taxonomy. 269 269 */ 270 function register_taxonomy() {270 protected function register_taxonomy() { 271 271 $labels = array( 272 272 'name' => _x( 'Job Categories', 'Taxonomy General Name', 'jobswp' ), … … 301 301 * user account does not exist. 302 302 */ 303 function alert_if_no_jobposter() {303 public function alert_if_no_jobposter() { 304 304 global $pagenow; 305 305 … … 319 319 * Outputs button to close a job on the post edit page. 320 320 */ 321 function post_submitbox_start() {321 public function post_submitbox_start() { 322 322 global $post; 323 323 … … 365 365 * @return boolean True == the job can be closed 366 366 */ 367 function can_job_be_closed( $post ) {367 protected function can_job_be_closed( $post ) { 368 368 // The post must exist 369 369 if ( ! $post ) … … 468 468 * @return array 469 469 */ 470 function post_row_actions( $actions, $post ) {470 public function post_row_actions( $actions, $post ) { 471 471 if ( $this->can_job_be_closed( $post ) ) 472 472 $actions['close'] = $this->_get_close_link( $post ); … … 483 483 * @return string The fixed text 484 484 */ 485 function WordPress_dangit( $text ) {485 public function WordPress_dangit( $text ) { 486 486 return str_replace( 487 487 array( 'Wordpress', 'wordpress', 'wordPress', 'word press', 'Word press', 'word Press', 'Word Press' ), … … 498 498 * @return string The content appended with the post-a-job form 499 499 */ 500 function add_post_a_job_form( $content ) {500 public function add_post_a_job_form( $content ) { 501 501 if ( ! $this->skip_content && is_page( 'post-a-job' ) ) { 502 502 $this->skip_content = true; … … 517 517 * unverified visitor. 518 518 */ 519 function save_job() {519 public function save_job() { 520 520 if ( isset( $_POST['postjob'] ) && 1 == $_POST['postjob'] ) { 521 521 check_admin_referer( 'jobswppostjob' ); … … 551 551 // If everything checks out, create the job 552 552 if ( $this->success ) { 553 554 553 $job_id = $this->create_job(); 555 556 554 if ( is_wp_error( $job_id ) ) { 557 555 $_POST['errors'] = $job_id->get_error_message(); … … 606 604 607 605 // Massage and sanitize the field value depending on field 608 $val = $this->validate_job_field( $field, $_POST[ $field ], $_POST );606 $val = self::validate_job_field( $field, $_POST[ $field ], $_POST ); 609 607 610 608 add_post_meta( $job_id, $field, $val ); … … 627 625 * Prunes old jobs. 628 626 */ 629 function scheduled_job_pruning() {627 public function scheduled_job_pruning() { 630 628 global $wpdb; 631 629 … … 641 639 * Unschedules job pruning cron. 642 640 */ 643 static function unschedule_job_pruning() {641 public static function unschedule_job_pruning() { 644 642 wp_clear_scheduled_hook( 'jobswp_scheduled_job_pruning' ); 645 643 } … … 658 656 * @return string 659 657 */ 660 function validate_job_field( $field, $value, $extra_data = array() ) {658 public static function validate_job_field( $field, $value, $extra_data = array() ) { 661 659 switch ( $field ) { 662 660 case 'email':
Note: See TracChangeset
for help on using the changeset viewer.