Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

General code cleanup.

This commit includes no functional changes, just source cleanup. This
includes renanming functions for better consistency, reorganizing class
methods for better readability, and correcting inline documentation
(among other things).
  • Loading branch information...
commit 3465fb2cb21b141628866f1909218f5c4d1ab7d2 1 parent 1440ff1
Michael Sisk authored
View
2  -/php/admin.php
@@ -23,9 +23,11 @@ class WebcomicAdmin extends Webcomic {
* @uses WebcomicAdmin::plugin_row_meta()
* @uses WebcomicAdmin::plugin_action_links()
* @uses WebcomicPosts
+ * @uses WebcomicPages
* @uses WebcomicUsers
* @uses WebcomicMedia
* @uses WebcomicConfig
+ * @uses WebcomicCommerce
* @uses WebcomicTaxonomy
* @uses WebcomicTranscripts
* @uses WebcomicLegacy
View
16 -/php/media.php
@@ -18,16 +18,20 @@ class WebcomicMedia extends Webcomic {
* @uses WebcomicMedia::admin_footer()
* @uses WebcomicMedia::delete_attachment()
* @uses WebcomicMedia::admin_enqueue_scripts()
+ * @uses WebcomicMedia::media_upload_webcomic_media()
+ * @uses WebcomicMedia::attachment_submitbox_misc_actions()
+ * @uses WebcomicMedia::media_upload_tabs()
* @uses WebcomicMedia::media_row_actions()
* @uses WebcomicMedia::display_media_states()
+ * @uses WebcomicMedia::image_size_names_choose()
*/
public function __construct() {
add_action( 'admin_init', array( $this, 'admin_init' ) );
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
add_action( 'admin_footer', array( $this, 'admin_footer' ) );
- add_action( 'media_upload_webcomic_media', array( $this, 'media' ) );
add_action( 'delete_attachment', array( $this, 'delete_attachment' ), 10, 1 );
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
+ add_action( 'media_upload_webcomic_media', array( $this, 'media_upload_webcomic_media' ) );
add_action( 'attachment_submitbox_misc_actions', array( $this, 'attachment_submitbox_misc_actions' ), 20 );
add_filter( 'media_upload_tabs', array( $this, 'media_upload_tabs' ), 10, 1 );
@@ -175,8 +179,8 @@ public function admin_init() {
* @hook admin_menu
*/
public function admin_menu() {
- add_submenu_page( 'upload.php', __( 'Webcomic Attacher', 'webcomic' ), __( 'Webcomic Attacher', 'webcomic' ), 'upload_files', 'webcomic-attacher', array( $this, 'attacher' ) );
- add_submenu_page( 'upload.php', __( 'Webcomic Generator', 'webcomic' ), __( 'Webcomic Generator', 'webcomic' ), 'upload_files', 'webcomic-generator', array( $this, 'generator' ) );
+ add_submenu_page( 'upload.php', __( 'Webcomic Attacher', 'webcomic' ), __( 'Webcomic Attacher', 'webcomic' ), 'upload_files', 'webcomic-attacher', array( $this, 'page_attacher' ) );
+ add_submenu_page( 'upload.php', __( 'Webcomic Generator', 'webcomic' ), __( 'Webcomic Generator', 'webcomic' ), 'upload_files', 'webcomic-generator', array( $this, 'page_generator' ) );
}
/** Render javascript for the webcomic generator.
@@ -195,7 +199,7 @@ public function admin_footer() {
*
* @hook media_upload_webcomic_media
*/
- public function media( $output = false ) {
+ public function media_upload_webcomic_media( $output = false ) {
if ( $output ) {
if ( $attachments = self::get_attachments( $_GET[ 'post_id' ] ) ) {
printf( '<div><p>%s</p><hr></div><ul class="webcomic-media">', __( 'Drag and drop the media attachments to change the order Webcomic will display them.', 'webcomic' ) );
@@ -407,7 +411,7 @@ public function image_size_names_choose( $sizes ) {
*
* @uses Webcomic::$config
*/
- public function attacher() {
+ public function page_attacher() {
global $wpdb, $post;
?>
<div class="wrap">
@@ -591,7 +595,7 @@ public function attacher() {
* @uses Webcomic::$config
* @uses Webcomic::get_attachments()
*/
- public function generator() {
+ public function page_generator() {
global $post;
$attachments = self::get_attachments();
View
76 -/php/pages.php
@@ -11,32 +11,31 @@
class WebcomicPages extends Webcomic {
/** Register hooks.
*
- * @uses Webcomic::$config
* @uses WebcomicPages::admin_footer()
* @uses WebcomicPages::add_meta_boxes()
- * @uses WebcomicPages::save_page()
+ * @uses WebcomicPages::wp_insert_post()
* @uses WebcomicPages::pre_post_update()
* @uses WebcomicPages::admin_enqueue_scripts()
* @uses WebcomicPages::bulk_edit_custom_box()
* @uses WebcomicPages::quick_edit_custom_box()
- * @uses WebcomicPages::manage_custom_column()
- * @uses WebcomicPages::manage_columns()
- * @uses WebcomicPages::manage_sortable_columns()
+ * @uses WebcomicPages::manage_page_posts_custom_column()
* @uses WebcomicPages::request()
+ * @uses WebcomicPages::manage_edit_page_columns()
+ * @uses WebcomicPages::manage_edit_page_sortable_columns()
*/
public function __construct() {
add_action( 'admin_footer', array( $this, 'admin_footer' ) );
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
- add_action( 'wp_insert_post', array( $this, 'save_page' ), 10, 2 );
+ add_action( 'wp_insert_post', array( $this, 'wp_insert_post' ), 10, 2 );
add_action( 'pre_post_update', array( $this, 'pre_post_update' ), 10, 1 );
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
add_action( 'bulk_edit_custom_box', array( $this, 'bulk_edit_custom_box' ), 10, 2 );
add_action( 'quick_edit_custom_box', array( $this, 'quick_edit_custom_box' ), 10, 2 );
- add_action( "manage_page_posts_custom_column", array( $this, 'manage_custom_column' ), 10, 2 );
+ add_action( 'manage_page_posts_custom_column', array( $this, 'manage_page_posts_custom_column' ), 10, 2 );
add_filter( 'request', array( $this, 'request' ), 10, 1 );
- add_filter( 'manage_edit-page_columns', array( $this, 'manage_columns' ), 10, 1 );
- add_filter( 'manage_edit-page_sortable_columns', array( $this, 'manage_sortable_columns' ), 10, 1 );
+ add_filter( 'manage_edit-page_columns', array( $this, 'manage_edit_page_columns' ), 10, 1 );
+ add_filter( 'manage_edit-page_sortable_columns', array( $this, 'manage_edit_page_sortable_columns' ), 10, 1 );
}
/** Render javascript for page meta boxes.
@@ -54,12 +53,11 @@ public function admin_footer() {
/** Add page meta boxes.
*
- * @uses Webcomic::$config
- * @uses WebcomicPages::page_collection()
+ * @uses WebcomicPages::box_webcomic_collection()
* @hook add_meta_boxes
*/
public function add_meta_boxes() {
- add_meta_box( 'webcomic-collection', __( 'Webcomic Collection', 'webcomic' ), array( $this, 'page_collection' ), 'page', 'side' );
+ add_meta_box( 'webcomic-collection', __( 'Webcomic Collection', 'webcomic' ), array( $this, 'box_webcomic_collection' ), 'page', 'side' );
}
/** Save metadata with pages.
@@ -68,7 +66,7 @@ public function add_meta_boxes() {
* @param object $post Post object to update.
* @hook wp_insert_post
*/
- public function save_page( $id, $post ) {
+ public function wp_insert_post( $id, $post ) {
if (
isset( $_POST[ 'webcomic_meta_collection' ], $_POST[ 'webcomic_page_collection' ] )
and 'page' === $post->post_type
@@ -185,36 +183,12 @@ public function quick_edit_custom_box( $column, $type ) {
* @param integer $id Current post ID.
* @hook manage_page_posts_custom_column
*/
- public function manage_custom_column( $column, $id ) {
+ public function manage_page_posts_custom_column( $column, $id ) {
if ( 'webcomic_collection' === $column ) {
echo ( $collection = get_post_meta( $id, 'webcomic_collection', true ) and isset( self::$config[ 'collections' ][ $collection ] ) ) ? sprintf( '<a href="%s">%s</a>', esc_url( add_query_arg( array( 'post_type' => 'page', 'meta_key' => 'webcomic_collection', 'meta_value' => $collection ), admin_url( 'edit.php' ) ) ), self::$config[ 'collections' ][ $collection ][ 'name' ] ) : __( 'No Collection', 'webcomic' );
}
}
- /** Add custom webcomic collection to management pages.
- *
- * @param array $columns Array of of post columns.
- * @return array
- * @hook manage_edit-page_columns
- */
- public function manage_columns( $columns ) {
- $pre = array_slice( $columns, 0, 3 );
-
- $pre[ 'webcomic_collection' ] = __( 'Webcomic Collection', 'webcomic' );
-
- return array_merge( $pre, $columns );
- }
-
- /** Add sortable webcomic collection column.
- *
- * @param array $columns An array of sortable columns.
- * @return array
- * @hook manage_edit-page_sortable_columns
- */
- public function manage_sortable_columns( $columns ) {
- return array_merge( array( 'webcomic_collection' => 'webcomic_collection' ), $columns );
- }
-
/** Handle sorting and filtering pages by webcomic collection.
*
* Because of how WordPress handles custom field queries, sorting
@@ -241,12 +215,36 @@ public function request( $request ) {
return $request;
}
+ /** Add custom webcomic collection to management pages.
+ *
+ * @param array $columns Array of of post columns.
+ * @return array
+ * @hook manage_edit-page_columns
+ */
+ public function manage_edit_page_columns( $columns ) {
+ $pre = array_slice( $columns, 0, 3 );
+
+ $pre[ 'webcomic_collection' ] = __( 'Webcomic Collection', 'webcomic' );
+
+ return array_merge( $pre, $columns );
+ }
+
+ /** Add sortable webcomic collection column.
+ *
+ * @param array $columns An array of sortable columns.
+ * @return array
+ * @hook manage_edit-page_sortable_columns
+ */
+ public function manage_edit_page_sortable_columns( $columns ) {
+ return array_merge( array( 'webcomic_collection' => 'webcomic_collection' ), $columns );
+ }
+
/** Render the page collection meta box.
*
* @param object $page Current page object.
* @uses Webcomic::$config
*/
- public function page_collection( $page ) {
+ public function box_webcomic_collection( $page ) {
$page_collection = get_post_meta( $page->ID, 'webcomic_collection', true );
wp_nonce_field( 'webcomic_meta_collection', 'webcomic_meta_collection' );
View
32 -/php/posts.php
@@ -24,9 +24,9 @@ class WebcomicPosts extends Webcomic {
* @uses WebcomicPosts::bulk_edit_custom_box()
* @uses WebcomicPosts::quick_edit_custom_box()
* @uses WebcomicPosts::posts_where()
- * @uses WebcomicPosts::manage_custom_column()
- * @uses WebcomicPosts::view_orphans()
- * @uses WebcomicPosts::manage_columns()
+ * @uses WebcomicPosts::manage_webcomic_posts_custom_column()
+ * @uses WebcomicPosts::view_edit_webcomics()
+ * @uses WebcomicPosts::manage_edit_webcomic_columns()
*/
public function __construct() {
add_action( 'admin_footer', array( $this, 'admin_footer' ) );
@@ -37,17 +37,17 @@ public function __construct() {
add_action( 'restrict_manage_posts', array( $this, 'restrict_manage_posts' ) );
add_action( 'wp_insert_post', array( $this, 'save_webcomic_commerce' ), 10, 2 );
add_action( 'wp_insert_post_data', array( $this, 'wp_insert_post_data' ), 10, 2 );
- add_action( 'wp_insert_post', array( $this, 'save_webcomic_transcripts' ), 10, 2 );
+ add_action( 'wp_insert_post,', array( $this, 'save_webcomic_transcripts' ), 10, 2 );
add_action( 'bulk_edit_custom_box', array( $this, 'bulk_edit_custom_box' ), 10, 2 );
add_action( 'quick_edit_custom_box', array( $this, 'quick_edit_custom_box' ), 10, 2 );
add_filter( 'posts_where', array( $this, 'posts_where' ), 10, 1 );
foreach ( array_keys( self::$config[ 'collections' ] ) as $k ) {
- add_action( "manage_{$k}_posts_custom_column", array( $this, 'manage_custom_column' ), 10, 2 );
+ add_action( "manage_{$k}_posts_custom_column", array( $this, 'manage_webcomic_posts_custom_column' ), 10, 2 );
- add_filter( "views_edit-{$k}", array( $this, 'view_orphans' ), 10, 1 );
- add_filter( "manage_edit-{$k}_columns", array( $this, 'manage_columns' ), 10, 1 );
+ add_filter( "views_edit-{$k}", array( $this, 'view_edit_webcomic' ), 10, 1 );
+ add_filter( "manage_edit-{$k}_columns", array( $this, 'manage_edit_webcomic_columns' ), 10, 1 );
}
}
@@ -76,9 +76,9 @@ public function admin_footer() {
*/
public function add_meta_boxes() {
foreach ( array_keys( self::$config[ 'collections' ] ) as $k ) {
- add_meta_box( 'webcomic-media', __( 'Webcomic Media', 'webcomic' ), array( $this, 'media' ), $k, 'side', 'high' );
- add_meta_box( 'webcomic-commerce', __( 'Webcomic Commerce', 'webcomic' ), array( $this, 'commerce' ), $k, 'normal', 'high' );
- add_meta_box( 'webcomic-transcripts', __( 'Webcomic Transcripts', 'webcomic' ), array( $this, 'transcripts' ), $k, 'normal', 'high' );
+ add_meta_box( 'webcomic-media', __( 'Webcomic Media', 'webcomic' ), array( $this, 'box_media' ), $k, 'side', 'high' );
+ add_meta_box( 'webcomic-commerce', __( 'Webcomic Commerce', 'webcomic' ), array( $this, 'box_commerce' ), $k, 'normal', 'high' );
+ add_meta_box( 'webcomic-transcripts', __( 'Webcomic Transcripts', 'webcomic' ), array( $this, 'box_transcripts' ), $k, 'normal', 'high' );
}
}
@@ -371,7 +371,7 @@ public function posts_where( $where ) {
* @uses Webcomic::get_attachments()
* @hook manage_(webcomic\d+)_posts_custom_column
*/
- public function manage_custom_column( $column, $id ) {
+ public function manage_webcomic_posts_custom_column( $column, $id ) {
global $post;
if ( 'webcomic_attachments' === $column ) {
@@ -424,7 +424,7 @@ public function manage_custom_column( $column, $id ) {
* @return array
* @hook views_edit-(webcomic\d+)
*/
- public function view_orphans( $views ) {
+ public function view_edit_webcomic( $views ) {
global $wpdb;
if ( $orphans = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->posts} WHERE post_type = %s AND ID NOT IN ( SELECT post_parent FROM {$wpdb->posts} WHERE post_type = 'attachment' AND post_mime_type LIKE 'image/%%' )", $_GET[ 'post_type' ] ) ) ) {
@@ -453,7 +453,7 @@ public function view_orphans( $views ) {
* @return array
* @hook manage_edit-(webcomic\d+)_columns
*/
- public function manage_columns( $columns ) {
+ public function manage_edit_webcomic_columns( $columns ) {
$pre = array_slice( $columns, 0, 1 );
$mid = array_slice( $columns, 1, 2 );
@@ -469,7 +469,7 @@ public function manage_columns( $columns ) {
* @param object $post Current post object.
* @uses WebcomicPosts::ajax_media_preview()
*/
- public function media( $post ) {
+ public function box_media( $post ) {
?>
<div id="webcomic_media_preview"><?php self::ajax_media_preview( $post->ID ); ?></div>
<?php
@@ -480,7 +480,7 @@ public function media( $post ) {
* @param object $post Current post object.
* @uses Webcomic::$config
*/
- public function commerce( $post ) {
+ public function box_commerce( $post ) {
$commerce = get_post_meta( $post->ID, 'webcomic_commerce', true );
$commerce = $commerce ? $commerce : array();
@@ -583,7 +583,7 @@ public function commerce( $post ) {
* @param object $post Current post object.
* @uses Webcomic::$config
*/
- public function transcripts( $post ) {
+ public function box_transcripts( $post ) {
wp_nonce_field( 'webcomic_meta_transcripts', 'webcomic_meta_transcripts' );
?>
<p><label><input type="checkbox" name="webcomic_transcripts"<?php checked( ( 'auto-draft' === $post->post_status and self::$config[ 'collections' ][ $post->post_type ][ 'transcripts' ][ 'open' ] ) or get_post_meta( $post->ID, 'webcomic_transcripts', true ) ); ?>> <?php _e( 'Allow transcribing', 'webcomic' ); ?></label></p>
View
12 -/php/taxonomy.php
@@ -278,7 +278,8 @@ public function get_terms_args( $args, $taxonomies ) {
*
* @filter integer webcomic_upload_size_limit Filters the maximum allowed upload size for cover and avatar uploads. Defaults to the value returned by `wp_max_upload_size`.
* @param string $taxonomy The add term form taxonomy.
- * @hook (webcomic\d+)_storyline_add_form_fields, (webcomic\d+)_character_add_form_fields
+ * @hook (webcomic\d+)_storyline_add_form_fields
+ * @hook (webcomic\d+)_character_add_form_fields
*/
public function add_form_fields( $taxonomy ) {
$sizes = array( 'KB', 'MB', 'GB' );
@@ -319,7 +320,8 @@ public function add_form_fields( $taxonomy ) {
* @filter integer webcomic_upload_size_limit Filters the maximum allowed upload size for cover and avatar uploads. Defaults to the value returned by `wp_max_upload_size`.
* @param object $term The current term object.
* @param string $taxonomy The taxonomy of the current term.
- * @hook (webcomic\d+)_storyline_edit_form_fields, (webcomic\d+)_character_edit_form_fields
+ * @hook (webcomic\d+)_storyline_edit_form_fields
+ * @hook (webcomic\d+)_character_edit_form_fields
*/
public function edit_form_fields( $term, $taxonomy ) {
$sizes = array( 'KB', 'MB', 'GB' );
@@ -384,7 +386,8 @@ public function storyline_row_actions( $actions, $term ) {
* @param string $value
* @param string $column Name of the current column.
* @param integer $id Current term ID.
- * @hook manage_(webcomic\d+)_storyline_custom_column, manage_(webcomic\d+)_character_custom_column
+ * @hook manage_(webcomic\d+)_storyline_custom_column
+ * @hook manage_(webcomic\d+)_character_custom_column
*/
public function manage_custom_column( $value, $column, $id ) {
if ( 'webcomic_image' === $column and isset( self::$config[ 'terms' ][ $id ][ 'image' ] ) and $image = wp_get_attachment_image( self::$config[ 'terms' ][ $id ][ 'image' ] ) ) {
@@ -399,7 +402,8 @@ public function manage_custom_column( $value, $column, $id ) {
*
* @param array $columns Array of of term columns.
* @return array
- * @hook manage_edit-(webcomic\d+)_storyline_columns, manage_edit-(webcomic\d+)_character_columns
+ * @hook manage_edit-(webcomic\d+)_storyline_columns
+ * @hook manage_edit-(webcomic\d+)_character_columns
*/
public function manage_edit_columns( $columns ) {
$screen = get_current_screen();
View
68 -/php/transcripts.php
@@ -17,14 +17,15 @@ class WebcomicTranscripts extends Webcomic {
* @uses WebcomicTranscripts::post_updated()
* @uses WebcomicTranscripts::restrict_manage_posts()
* @uses WebcomicTranscripts::admin_enqueue_scripts()
+ * @uses WebcomicTranscripts::wp_insert_post()
* @uses WebcomicTranscripts::wp_insert_post_data()
- * @uses WebcomicTranscripts::manage_custom_column()
+ * @uses WebcomicTranscripts::manage_webcomic_transcript_posts_custom_column()
* @uses WebcomicTranscripts::request()
* @uses WebcomicTranscripts::posts_where()
- * @uses WebcomicTranscripts::view_orphans()
- * @uses WebcomicTranscripts::manage_columns()
- * @uses WebcomicTranscripts::manage_language_columns()
- * @uses WebcomicTranscripts::manage_sortable_columns()
+ * @uses WebcomicTranscripts::view_wedit_webcomic_transcript()
+ * @uses WebcomicTranscripts::manage_edit_webcomic_language_columns()
+ * @uses WebcomicTranscripts::manage_edit_webcomic_transcript_columns()
+ * @uses WebcomicTranscripts::manage_edit_webcomic_transcript_sortable_columns()
*/
public function __construct() {
add_action( 'delete_post', array( $this, 'delete_post' ) );
@@ -33,16 +34,16 @@ public function __construct() {
add_action( 'post_updated', array( $this, 'post_updated' ), 10, 3 );
add_action( 'restrict_manage_posts', array( $this, 'restrict_manage_posts' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
- add_action( 'wp_insert_post', array( $this, 'save_webcomic_authors' ), 10, 2 );
+ add_action( 'wp_insert_post', array( $this, 'wp_insert_post' ), 10, 2 );
add_action( 'wp_insert_post_data', array( $this, 'wp_insert_post_data' ), 10, 2 );
- add_action( 'manage_webcomic_transcript_posts_custom_column', array( $this, 'manage_custom_column' ), 10, 2 );
+ add_action( 'manage_webcomic_transcript_posts_custom_column', array( $this, 'manage_webcomic_transcript_posts_custom_column' ), 10, 2 );
add_filter( 'request', array( $this, 'request' ), 10, 1 );
add_filter( 'posts_where', array( $this, 'posts_where' ), 10, 1 );
- add_filter( 'views_edit-webcomic_transcript', array( $this, 'view_orphans' ), 10, 1 );
- add_filter( 'manage_edit-webcomic_transcript_columns', array( $this, 'manage_columns' ), 10, 1 );
- add_filter( 'manage_edit-webcomic_language_columns', array( $this, 'manage_language_columns' ), 10, 3 );
- add_filter( 'manage_edit-webcomic_transcript_sortable_columns', array( $this, 'manage_sortable_columns' ), 10, 1 );
+ add_filter( 'views_edit-webcomic_transcript', array( $this, 'view_wedit_webcomic_transcript' ), 10, 1 );
+ add_filter( 'manage_edit-webcomic_language_columns', array( $this, 'manage_edit_webcomic_language_columns' ), 10, 3 );
+ add_filter( 'manage_edit-webcomic_transcript_columns', array( $this, 'manage_edit_webcomic_transcript_columns' ), 10, 1 );
+ add_filter( 'manage_edit-webcomic_transcript_sortable_columns', array( $this, 'manage_edit_webcomic_transcript_sortable_columns' ), 10, 1 );
}
/** Remove parent from transcripts.
@@ -73,12 +74,13 @@ public function admin_footer() {
/** Add transcript meta boxes.
*
- * @uses WebcomicTranscripts::parent()
+ * @uses WebcomicTranscripts::box_parent()
+ * @uses WebcomicTranscripts::box_authors()
* @hook add_meta_boxes
*/
public function add_meta_boxes() {
- add_meta_box( 'webcomic-parent', __( 'Parent Webcomic', 'webcomic' ), array( $this, 'parent' ), 'webcomic_transcript', 'normal', 'high' );
- add_meta_box( 'webcomic-authors', __( 'Transcript Authors', 'webcomic' ), array( $this, 'authors' ), 'webcomic_transcript', 'normal', 'high' );
+ add_meta_box( 'webcomic-parent', __( 'Parent Webcomic', 'webcomic' ), array( $this, 'box_parent' ), 'webcomic_transcript', 'normal', 'high' );
+ add_meta_box( 'webcomic-authors', __( 'Transcript Authors', 'webcomic' ), array( $this, 'box_authors' ), 'webcomic_transcript', 'normal', 'high' );
}
/** Update transcripts when their parent webcomics are updated.
@@ -177,7 +179,7 @@ public function admin_enqueue_scripts() {
* @param object $post Post object to update.
* @hook wp_insert_post
*/
- public function save_webcomic_authors( $id, $post ) {
+ public function wp_insert_post( $id, $post ) {
if (
'webcomic_transcript' === $post->post_type
and ( !defined( 'DOING_AUTOSAVE' ) or !DOING_AUTOSAVE )
@@ -251,7 +253,7 @@ public function wp_insert_post_data( $data, $raw ) {
* @param integer $id Current post ID.
* @hook manage_webcomic_transcript_posts_custom_column
*/
- public function manage_custom_column( $column, $id ) {
+ public function manage_webcomic_transcript_posts_custom_column( $column, $id ) {
global $post;
if ( 'webcomic_author' === $column ) {
@@ -337,7 +339,7 @@ public function posts_where( $where ) {
* @return array
* @hook views_edit-(webcomic\d+)
*/
- public function view_orphans( $views ) {
+ public function view_wedit_webcomic_transcript( $views ) {
global $wpdb;
if ( $orphans = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->posts} WHERE post_type = 'webcomic_transcript' AND post_parent = 0" ) ) {
@@ -360,13 +362,25 @@ public function view_orphans( $views ) {
return $views;
}
+ /** Rename the language 'Posts' column.
+ *
+ * @param array $columns An array of term columns.
+ * @return array
+ * @hook manage_edit-webcomic_language_columns
+ */
+ public function manage_edit_webcomic_language_columns( $columns ) {
+ $columns[ 'posts' ] = __( 'Transcripts', 'webcomic' );
+
+ return $columns;
+ }
+
/** Add transcript languages, parent, and custom author columns.
*
* @param array $columns An array of post columns.
* @return array
* @hook manage_edit-webcomic_transcript_columns
*/
- public function manage_columns( $columns ) {
+ public function manage_edit_webcomic_transcript_columns( $columns ) {
unset( $columns[ 'author' ] );
$pre = array_slice( $columns, 0, 2 );
@@ -378,25 +392,13 @@ public function manage_columns( $columns ) {
return array_merge( $pre, $columns );
}
- /** Rename the language 'Posts' column.
- *
- * @param array $columns An array of term columns.
- * @return array
- * @hook manage_edit-webcomic_language_columns
- */
- public function manage_language_columns( $columns ) {
- $columns[ 'posts' ] = __( 'Transcripts', 'webcomic' );
-
- return $columns;
- }
-
/** Add sortable parent and author columns.
*
* @param array $columns An array of sortable columns.
* @return array
* @hook manage_edit-webcomic_transcript_sortable_columns
*/
- public function manage_sortable_columns( $columns ) {
+ public function manage_edit_webcomic_transcript_sortable_columns( $columns ) {
return array_merge( array( 'webcomic_author' => 'webcomic_author', 'webcomic_parent' => 'webcomic_parent' ), $columns );
}
@@ -408,7 +410,7 @@ public function manage_sortable_columns( $columns ) {
* @uses WebcomicTranscripts::ajax_post_transcripts()
* @uses WebcomicTranscripts::ajax_preview()
*/
- public function parent( $post ) {
+ public function box_parent( $post ) {
$parent_type = get_post_type( $post->post_parent );
if ( 'webcomic_transcript' === $parent_type ) {
@@ -445,7 +447,7 @@ public function parent( $post ) {
* @param object $post Current post object.
* @uses Webcomic::$config
*/
- public function authors( $post ) {
+ public function box_authors( $post ) {
$count = 0;
$authors = get_post_meta( $post->ID, 'webcomic_author' );
View
2  -/php/upgrade.php
@@ -11,9 +11,9 @@
class WebcomicUpgrade extends Webcomic {
/** Upgrade existing installations.
*
- * @uses WebcomicUpgrade::_403
* @uses Webcomic::$config
* @uses Webcomic::$version
+ * @uses WebcomicUpgrade::_403
*/
public function __construct() {
if ( version_compare( self::$config[ 'version' ], '4.0.3', '<' ) ) {
View
3  -/php/users.php
@@ -35,7 +35,8 @@ public function profile_update( $id, $data ) {
/** Render meta inputs for user profile form.
*
* @param object $user Current user object.
- * @hook show_user_profile, edit_user_profile
+ * @hook show_user_profile
+ * @hook edit_user_profile
*/
public function user_profile( $user ) {
$birthday = get_user_meta( $user->ID, 'webcomic_birthday', true );
View
24 webcomic.php
@@ -90,14 +90,14 @@ class Webcomic {
* @uses Webcomic::$config
* @uses Webcomic::init()
* @uses Webcomic::log_ipn()
- * @uses Webcomic::head()
+ * @uses Webcomic::wp_head()
* @uses Webcomic::twitter_oauth()
* @uses Webcomic::save_transcript()
* @uses Webcomic::webcomic_redirect()
* @uses Webcomic::setup_theme()
* @uses Webcomic::the_post()
* @uses Webcomic::buffer_alert()
- * @uses Webcomic::enqueue_scripts()
+ * @uses Webcomic::wp_enqueue_scripts()
* @uses Webcomic::template_redirect()
* @uses Webcomic::tweet_webcomic()
* @uses Webcomic::request()
@@ -110,9 +110,9 @@ class Webcomic {
* @uses Webcomic::get_the_terms()
* @uses Webcomic::post_type_link()
* @uses Webcomic::the_content_feed()
- * @uses Webcomic::get_object_terms()
+ * @uses Webcomic::wp_get_object_terms()
* @uses Webcomic::extra_theme_headers()
- * @uses Webcomic::get_attachment_image_attributes()
+ * @uses Webcomic::wp_get_attachment_image_attributes()
* @uses Webcomic::loop_end()
* @uses Webcomic::loop_start()
* @uses Webcomic::the_excerpt()
@@ -129,7 +129,7 @@ public function __construct() {
if ( self::$config and version_compare( self::$config[ 'version' ], '4x', '>=' ) ) {
add_action( 'init', array( $this, 'init' ) );
add_action( 'init', array( $this, 'log_ipn' ) );
- add_action( 'wp_head', array( $this, 'head' ), 1 );
+ add_action( 'wp_head', array( $this, 'wp_head' ), 1 );
add_action( 'init', array( $this, 'twitter_oauth' ) );
add_action( 'init', array( $this, 'save_transcript' ) );
add_action( 'init', array( $this, 'dynamic_defaults' ) );
@@ -137,7 +137,7 @@ public function __construct() {
add_action( 'setup_theme', array( $this, 'setup_theme' ) );
add_action( 'the_post', array( $this, 'the_post' ), 10, 1 );
add_action( 'webcomic_buffer_alert', array( $this, 'buffer_alert' ) );
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
+ add_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_scripts' ) );
add_action( 'template_redirect', array( $this, 'template_redirect' ) );
add_action( 'transition_post_status', array( $this, 'tweet_webcomic' ), 10, 3 );
@@ -151,9 +151,9 @@ public function __construct() {
add_filter( 'get_the_terms', array( $this, 'get_the_terms' ), 10, 3 );
add_action( 'post_type_link', array( $this, 'post_type_link' ), 10, 4 );
add_filter( 'the_content_feed', array( $this, 'the_content_feed' ), 10, 1 );
- add_filter( 'wp_get_object_terms', array( $this, 'get_object_terms' ), 10, 4 );
+ add_filter( 'wp_get_object_terms', array( $this, 'wp_get_object_terms' ), 10, 4 );
add_filter( 'extra_theme_headers', array( $this, 'extra_theme_headers' ), 10, 1 );
- add_filter( 'wp_get_attachment_image_attributes', array( $this, 'get_attachment_image_attributes' ), 10, 2 );
+ add_filter( 'wp_get_attachment_image_attributes', array( $this, 'wp_get_attachment_image_attributes' ), 10, 2 );
if ( self::$config[ 'integrate' ] ) {
add_action( 'loop_end', array( $this, 'loop_end' ), 10, 1 );
@@ -469,7 +469,7 @@ public function log_ipn() {
* @hook wp_head
* @filter array webcomic_opengraph Filters the Open Graph data Webcomic adds to all Webcomic-related pages.
*/
- public function head() {
+ public function wp_head() {
global $wp_query, $post;
$output = array();
@@ -854,7 +854,7 @@ public function buffer_alert() {
* @uses Webcomic::$config
* @hook wp_enqueue_scripts
*/
- public function enqueue_scripts() {
+ public function wp_enqueue_scripts() {
if ( self::$config[ 'shortcuts' ] ) {
wp_register_script( 'webcomic-shortcuts', self::$url . '-/js/shortcuts.js', array( 'jquery', 'jquery-hotkeys' ), false, true );
@@ -1250,7 +1250,7 @@ public function the_content_feed( $content ) {
* @uses Webcomic::$config
* @hook get_the_terms
*/
- public function get_object_terms( $terms, $objects, $taxonomies, $args ) {
+ public function wp_get_object_terms( $terms, $objects, $taxonomies, $args ) {
if ( 'all' === $args[ 'fields' ] and preg_match( '/webcomic\d+_(storyline|character)/', join( ' ', ( array ) $taxonomies ) ) ) {
foreach ( $terms as $k => $v ) {
if ( isset( $v->taxonomy ) and preg_match( '/^webcomic\d+_(storyline|character)$/', $v->taxonomy ) ) {
@@ -1288,7 +1288,7 @@ public function extra_theme_headers( $extra ) {
* @uses Webcomic::$config
* @hook wp_get_attachment_image_attributes
*/
- public function get_attachment_image_attributes( $attributes, $attachment ) {
+ public function wp_get_attachment_image_attributes( $attributes, $attachment ) {
if ( $attachment->post_parent and isset( self::$config[ 'collections' ][ get_post_type( $attachment->post_parent ) ] ) ) {
$attributes[ 'data-webcomic-parent' ] = $attachment->post_parent;
Please sign in to comment.
Something went wrong with that request. Please try again.