Completed
Pull Request — add/telegram-sharebuttons (#3775)
by
unknown
30:50 queued 21:07
created

Jetpack_Comic::site_supports_comics()   D

Complexity

Conditions 9
Paths 8

Size

Total Lines 41
Code Lines 14

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 41
rs 4.909
cc 9
eloc 14
nc 8
nop 0
1
<?php
2
3
class Jetpack_Comic {
4
	const POST_TYPE = 'jetpack-comic';
5
6
	static function init() {
7
		static $instance = false;
8
9
		if ( ! $instance )
10
			$instance = new Jetpack_Comic;
11
12
		return $instance;
13
	}
14
15
	/**
16
	 * Conditionally hook into WordPress.
17
	 *
18
	 * Themes must declare that they support this module by adding
19
	 * add_theme_support( 'jetpack-comic' ); during after_setup_theme.
20
	 *
21
	 * If no theme support is found there is no need to hook into
22
	 * WordPress. We'll just return early instead.
23
	 */
24
	function __construct() {
25
		// Make sure the post types are loaded for imports
26
		add_action( 'import_start', array( $this, 'register_post_types' ) );
27
28
		// Add to REST API post type whitelist
29
		add_filter( 'rest_api_allowed_post_types', array( $this, 'allow_rest_api_type' ) );
30
31
		// If called via REST API, we need to register later in lifecycle
32
		add_action( 'restapi_theme_init', array( $this, 'maybe_register_post_types' ) );
33
34
		// Return early if theme does not support Jetpack Comic.
35
		if ( ! ( $this->site_supports_comics() ) )
36
			return;
37
38
		$this->register_post_types();
39
40
		add_action( 'pre_get_posts', array( $this, 'add_posts_to_loop' ) );
41
42
		// In order for the Feedbag job to find Comic posts, we need to circumvent any pretty
43
		// URLs in the RSS feed given to Feedbag in favor of /?p=123&post_type=jetpack-comic
44
		add_filter( 'the_permalink_rss', array( $this, 'custom_permalink_for_feedbag' ) );
45
46
		// There are some cases (like when Feedbag is fetching posts) that the comics
47
		// post type needs to be registered no matter what, but none of the UI needs to be
48
		// available.
49
50
		// Enable Omnisearch for Comic posts.
51
		if ( class_exists( 'Jetpack_Omnisearch_Posts' ) )
52
			new Jetpack_Omnisearch_Posts( self::POST_TYPE );
53
54
		add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );
55
56
		if ( function_exists( 'queue_publish_post' ) ) {
57
			add_action( 'publish_jetpack-comic', 'queue_publish_post', 10, 2 );
58
		}
59
60
		add_action( 'pre_get_posts', array( $this, 'include_in_feeds' ) );
61
62
		add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
63
64
		add_filter( 'manage_' . self::POST_TYPE . '_posts_columns', array( $this, 'manage_posts_columns' ) );
65
		add_action( 'manage_' . self::POST_TYPE . '_posts_custom_column', array( $this, 'manage_posts_custom_column' ), 10, 2 );
66
		add_image_size( 'jetpack-comic-thumb', 150, 0, false );
67
68
		// Enable front-end uploading for users special enough.
69
		if ( current_user_can( 'upload_files' ) && current_user_can( 'edit_posts' ) ) {
70
			add_action( 'wp_ajax_jetpack_comic_upload', array( $this, 'upload' ) );
71
			add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ) );
72
		}
73
74
		/**
75
		 * Add a "Convert to Comic" and "Convert to Post" option to the bulk
76
		 * edit dropdowns.
77
		 */
78
		add_action( 'admin_footer-edit.php', array( $this, 'admin_footer' ) );
79
		add_action( 'load-edit.php', array( $this, 'bulk_edit' ) );
80
		add_action( 'admin_notices', array( $this, 'bulk_edit_notices' ) );
81
82
	}
83
84
	public function admin_footer() {
85
		$post_type = get_post_type();
86
87
		?>
88
		<script type="text/javascript">
89
			jQuery( document ).ready( function( $ ) {
90 View Code Duplication
				<?php if ( ! $post_type || 'post' == $post_type ) { ?>
91
					$( '<option>' )
92
						.val( 'post2comic' )
93
						.text( <?php echo json_encode( __( 'Convert to Comic', 'jetpack' ) ); ?> )
94
						.appendTo( "select[name='action'], select[name='action2']" );
95
				<?php } ?>
96 View Code Duplication
				<?php if ( ! $post_type || self::POST_TYPE == $post_type ) { ?>
97
					$( '<option>' )
98
						.val( 'comic2post' )
99
						.text( <?php echo json_encode( __( 'Convert to Post', 'jetpack' ) ); ?> )
100
						.appendTo( "select[name='action'], select[name='action2']" );
101
				<?php } ?>
102
103
				$( '#message.jetpack-comic-post-type-conversion' ).remove().insertAfter( $( '.wrap h2:first' ) ).show();
104
			});
105
		</script>
106
		<?php
107
	}
108
109
	/**
110
	 * Handle the "Convert to [Post|Comic]" bulk action.
111
	 */
112
	public function bulk_edit() {
113
		if ( empty( $_REQUEST['post'] ) )
114
			return;
115
116
		$wp_list_table = _get_list_table( 'WP_Posts_List_Table' );
117
		$action = $wp_list_table->current_action();
118
119
		check_admin_referer( 'bulk-posts' );
120
121
		if ( 'post2comic' == $action || 'comic2post' == $action ) {
122
			if ( ! current_user_can( 'publish_posts' ) )
123
				wp_die( __( 'You are not allowed to make this change.', 'jetpack' ) );
124
125
			$post_ids = array_map( 'intval', $_REQUEST['post'] );
126
127
			$modified_count = 0;
128
129
			foreach ( $post_ids as $post_id ) {
130
				$destination_post_type = ( $action == 'post2comic' ) ? self::POST_TYPE : 'post';
131
				$origin_post_type = ( $destination_post_type == 'post' ) ? self::POST_TYPE : 'post';
132
133
				if ( current_user_can( 'edit_post', $post_id ) ) {
134
					$post = get_post( $post_id );
135
136
					// Only convert posts that are post => comic or comic => post.
137
					// (e.g., Ignore comic => comic, page => post, etc. )
138
					if ( $post->post_type != $destination_post_type && $post->post_type == $origin_post_type ) {
139
						$post_type_object = get_post_type_object( $destination_post_type );
140
141
						if ( current_user_can( $post_type_object->cap->publish_posts ) ) {
142
							set_post_type( $post_id, $destination_post_type );
143
							$modified_count++;
144
						}
145
					}
146
				}
147
			}
148
149
			$sendback = remove_query_arg( array( 'exported', 'untrashed', 'deleted', 'ids' ), wp_get_referer() );
150
151
			if ( ! $sendback )
152
				$sendback = add_query_arg( array( 'post_type', get_post_type() ), admin_url( 'edit.php' ) );
153
154
			$pagenum = $wp_list_table->get_pagenum();
155
			$sendback = add_query_arg( array( 'paged' => $pagenum, 'post_type_changed' => $modified_count ), $sendback );
156
157
			wp_safe_redirect( $sendback );
158
			exit();
0 ignored issues
show
Coding Style Compatibility introduced by
The method bulk_edit() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
159
		}
160
	}
161
162
	/**
163
	 * Show the post conversion success notice.
164
	 */
165
	public function bulk_edit_notices() {
166
		global $pagenow;
167
168
		if ( 'edit.php' == $pagenow && ! empty( $_GET['post_type_changed'] ) ) {
169
			?><div id="message" class="updated below-h2 jetpack-comic-post-type-conversion" style="display: none;"><p><?php
170
			printf( _n( 'Post converted.', '%s posts converted', $_GET['post_type_changed'], 'jetpack' ), number_format_i18n( $_GET['post_type_changed'] ) );
171
			?></p></div><?php
172
		}
173
	}
174
175
	public function register_scripts() {
176
		if( is_rtl() ) {
177
			wp_enqueue_style( 'jetpack-comics-style', plugins_url( 'comics/rtl/comics-rtl.css', __FILE__ ) );
178
		} else {
179
			wp_enqueue_style( 'jetpack-comics-style', plugins_url( 'comics/comics.css', __FILE__ ) );
180
		}
181
182
		wp_enqueue_script( 'jetpack-comics', plugins_url( 'comics/comics.js', __FILE__ ), array( 'jquery', 'jquery.spin' ) );
183
184
		$options = array(
185
			'nonce' => wp_create_nonce( 'jetpack_comic_upload_nonce' ),
186
			'writeURL' => admin_url( 'admin-ajax.php?action=jetpack_comic_upload' ),
187
			'labels' => array(
188
				'dragging' => __( 'Drop images to upload', 'jetpack' ),
189
				'uploading' => __( 'Uploading...', 'jetpack' ),
190
				'processing' => __( 'Processing...', 'jetpack' ),
191
				'unsupported' => __( "Sorry, your browser isn't supported. Upgrade at browsehappy.com.", 'jetpack' ),
192
				'invalidUpload' => __( 'Only images can be uploaded here.', 'jetpack' ),
193
				'error' => __( "Your upload didn't complete; try again later or cross your fingers and try again right now.", 'jetpack' ),
194
			)
195
		);
196
197
		wp_localize_script( 'jetpack-comics', 'Jetpack_Comics_Options', $options );
198
	}
199
200
	public function admin_enqueue_scripts() {
201
		wp_enqueue_style( 'jetpack-comics-admin', plugins_url( 'comics/admin.css', __FILE__ ) );
202
	}
203
204
	public function maybe_register_post_types() {
205
		// Return early if theme does not support Jetpack Comic.
206
		if ( ! ( $this->site_supports_comics() ) )
207
			return;
208
209
		$this->register_post_types();
210
	}
211
212
	function register_post_types() {
213
		if ( post_type_exists( self::POST_TYPE ) ) {
214
			return;
215
		}
216
217
		register_post_type( self::POST_TYPE, array(
218
			'description' => __( 'Comics', 'jetpack' ),
219
			'labels' => array(
220
				'name'                  => esc_html__( 'Comics',                   'jetpack' ),
221
				'singular_name'         => esc_html__( 'Comic',                    'jetpack' ),
222
				'menu_name'             => esc_html__( 'Comics',                   'jetpack' ),
223
				'all_items'             => esc_html__( 'All Comics',               'jetpack' ),
224
				'add_new'               => esc_html__( 'Add New',                  'jetpack' ),
225
				'add_new_item'          => esc_html__( 'Add New Comic',            'jetpack' ),
226
				'edit_item'             => esc_html__( 'Edit Comic',               'jetpack' ),
227
				'new_item'              => esc_html__( 'New Comic',                'jetpack' ),
228
				'view_item'             => esc_html__( 'View Comic',               'jetpack' ),
229
				'search_items'          => esc_html__( 'Search Comics',            'jetpack' ),
230
				'not_found'             => esc_html__( 'No Comics found',          'jetpack' ),
231
				'not_found_in_trash'    => esc_html__( 'No Comics found in Trash', 'jetpack' ),
232
				'filter_items_list'     => esc_html__( 'Filter comics list',       'jetpack' ),
233
				'items_list_navigation' => esc_html__( 'Comics list navigation',   'jetpack' ),
234
				'items_list'            => esc_html__( 'Comics list',              'jetpack' ),
235
			),
236
			'supports' => array(
237
				'title',
238
				'editor',
239
				'thumbnail',
240
				'comments',
241
				'revisions',
242
				'publicize', // Jetpack
243
				'subscriptions', // wpcom
244
				'shortlinks', // Jetpack
245
			),
246
			'rewrite' => array(
247
				'slug'       => 'comic',
248
				'with_front' => false,
249
			),
250
			'taxonomies' => array(
251
				'category',
252
				'post_tag',
253
			),
254
			// Only make the type public for sites that support Comics.
255
			'public'          => true,
256
			'menu_position'   => 5, // below Posts
257
			'map_meta_cap'    => true,
258
			'has_archive'     => true,
259
			'query_var'       => 'comic',
260
		) );
261
	}
262
263
	public function manage_posts_columns( $columns ) {
264
		$new_columns = array(
265
			'preview-jetpack-comic' => __( 'Preview', 'jetpack' ),
266
		);
267
		return array_merge( array_slice( $columns, 0, 2 ), $new_columns, array_slice( $columns, 2 ) );
268
	}
269
270
	public function manage_posts_custom_column( $column_name, $post_ID ) {
271
		if ( 'preview-jetpack-comic' == $column_name && has_post_thumbnail( $post_ID ) ) {
272
			echo get_the_post_thumbnail( $post_ID, 'jetpack-comic-thumb' );
273
		}
274
	}
275
276
	/**
277
	 * The function url_to_postid() doesn't handle pretty permalinks
278
	 * for CPTs very well. When we're generating an RSS feed to be consumed
279
	 * for Feedbag (the Reader's feed storage mechanism), eschew
280
	 * a pretty URL for one that will get the post into the Reader.
281
	 *
282
	 * @see http://core.trac.wordpress.org/ticket/19744
283
	 * @param string $permalink The existing (possibly pretty) permalink.
284
	 */
285
	public function custom_permalink_for_feedbag( $permalink ) {
286
		global $post;
287
288
		if ( ! empty( $GLOBALS['is_feedbag_rss_script'] ) && self::POST_TYPE == $post->post_type ) {
289
			$permalink = home_url( add_query_arg( array( 'p' => $post->ID, 'post_type' => self::POST_TYPE ), '?' ) );
290
		}
291
292
		return $permalink;
293
	}
294
295
	/*
296
	 * Update messages for the Comic admin.
297
	 */
298 View Code Duplication
	function updated_messages( $messages ) {
299
		global $post;
300
301
		$messages['jetpack-comic'] = array(
302
			0  => '', // Unused. Messages start at index 1.
303
			1  => sprintf( __( 'Comic updated. <a href="%s">View comic</a>', 'jetpack'), esc_url( get_permalink( $post->ID ) ) ),
304
			2  => esc_html__( 'Custom field updated.', 'jetpack' ),
305
			3  => esc_html__( 'Custom field deleted.', 'jetpack' ),
306
			4  => esc_html__( 'Comic updated.', 'jetpack' ),
307
			/* translators: %s: date and time of the revision */
308
			5  => isset( $_GET['revision'] ) ? sprintf( esc_html__( 'Comic restored to revision from %s', 'jetpack'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
309
			6  => sprintf( __( 'Comic published. <a href="%s">View comic</a>', 'jetpack' ), esc_url( get_permalink( $post->ID ) ) ),
310
			7  => esc_html__( 'Comic saved.', 'jetpack' ),
311
			8  => sprintf( __( 'Comic submitted. <a target="_blank" href="%s">Preview comic</a>', 'jetpack'), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) ),
312
			9  => sprintf( __( 'Comic scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview comic</a>', 'jetpack' ),
313
			// translators: Publish box date format, see http://php.net/date
314
			date_i18n( __( 'M j, Y @ G:i', 'jetpack' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post->ID) ) ),
315
			10 => sprintf( __( 'Comic draft updated. <a target="_blank" href="%s">Preview comic</a>', 'jetpack' ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) ),
316
		);
317
318
		return $messages;
319
	}
320
321
	/**
322
	 * Should this Custom Post Type be made available?
323
	 */
324
	public function site_supports_comics() {
325
		/**
326
		 * @todo: Extract this out into a wpcom only file.
0 ignored issues
show
Coding Style introduced by
Comment refers to a TODO task

This check looks TODO comments that have been left in the code.

``TODO``s show that something is left unfinished and should be attended to.

Loading history...
327
		 */
328
		if ( 'blog-rss.php' == substr( $_SERVER['PHP_SELF'], -12 ) && count( $_SERVER['argv'] ) > 1 ) {
329
			// blog-rss.php isn't run in the context of the target blog when the init action fires,
330
			// so check manually whether the target blog supports comics.
331
			switch_to_blog( $_SERVER['argv'][1] );
332
			// The add_theme_support( 'jetpack-comic' ) won't fire on switch_to_blog, so check for Panel manually.
333
			$supports_comics = ( ( function_exists( 'site_vertical' ) && 'comics' == site_vertical() )
334
								|| current_theme_supports( self::POST_TYPE )
335
								|| get_stylesheet() == 'pub/panel' );
336
			restore_current_blog();
337
338
			/** This action is documented in modules/custom-post-types/nova.php */
339
			return (bool) apply_filters( 'jetpack_enable_cpt', $supports_comics, self::POST_TYPE );
340
		}
341
342
		$supports_comics = false;
343
344
		/**
345
		 * If we're on WordPress.com, and it has the menu site vertical.
346
		 * @todo: Extract this out into a wpcom only file.
0 ignored issues
show
Coding Style introduced by
Comment refers to a TODO task

This check looks TODO comments that have been left in the code.

``TODO``s show that something is left unfinished and should be attended to.

Loading history...
347
		 */
348
		if ( function_exists( 'site_vertical' ) && 'comics' == site_vertical() ) {
349
			$supports_comics = true;
350
		}
351
352
		/**
353
		 * Else, if the current theme requests it.
354
		 */
355
		if ( current_theme_supports( self::POST_TYPE ) ) {
356
			$supports_comics = true;
357
		}
358
359
		/**
360
		 * Filter it in case something else knows better.
361
		 */
362
		/** This action is documented in modules/custom-post-types/nova.php */
363
		return (bool) apply_filters( 'jetpack_enable_cpt', $supports_comics, self::POST_TYPE );
364
	}
365
366
	/**
367
	 * Anywhere that a feed is displaying posts, show comics too.
368
	 *
369
	 * @param WP_Query $query
370
	 */
371
	public function include_in_feeds( $query ) {
372
		if ( ! $query->is_feed() )
373
			return;
374
375
		// Don't modify the query if the post type isn't public.
376
		if ( ! get_post_type_object( 'jetpack-comic' )->public )
377
			return;
378
379
		$query_post_types = $query->get( 'post_type' );
380
381
		if ( empty( $query_post_types ) )
382
			$query_post_types = 'post';
383
384
		if ( ! is_array( $query_post_types ) )
385
			$query_post_types = array( $query_post_types );
386
387
		if ( in_array( 'post', $query_post_types ) ) {
388
			$query_post_types[] = self::POST_TYPE;
389
			$query->set( 'post_type', $query_post_types );
390
		}
391
	}
392
393
	/**
394
	 * API endpoint for front-end image uploading.
395
	 */
396
	public function upload() {
397
		global $content_width;
398
399
		header( 'Content-Type: application/json' );
400
401
		if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'jetpack_comic_upload_nonce' ) )
402
			die( json_encode( array( 'error' => __( 'Invalid or expired nonce.', 'jetpack' ) ) ) );
0 ignored issues
show
Coding Style Compatibility introduced by
The method upload() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
403
404
		$_POST['action'] = 'wp_handle_upload';
405
406
		$image_id_arr = array();
407
		$image_error_arr = array();
408
409
		$i = 0;
410
411
		while ( isset( $_FILES['image_' . $i ] ) ) {
412
			// Create attachment for the image.
413
			$image_id = media_handle_upload( "image_$i", 0 );
414
415
			if ( is_wp_error( $image_id ) ) {
416
				$error = array( $image_id, $image_id->get_error_message() );
417
				array_push( $image_error_arr, $error );
418
			} else {
419
				array_push( $image_id_arr, $image_id );
420
			}
421
422
			$i++;
423
		}
424
425
		if ( count( $image_id_arr ) == 0 ) {
426
			// All image uploads failed.
427
			$rv = array( 'error' => '' );
428
429
			foreach ( $image_error_arr as $error )
430
				$rv['error'] .= $error[1] . "\n";
431
		}
432
		else {
433
			if ( count( $image_id_arr ) == 1 ) {
434
				$image_id = $image_id_arr[0];
435
436
				// Get the image
437
				$image_src = get_the_guid( $image_id );
438
				$image_dims = wp_get_attachment_image_src( $image_id, 'full' );
439
440
				// Take off 10px of width to account for padding and border. @todo make this smarter.
0 ignored issues
show
Coding Style Best Practice introduced by
Comments for TODO tasks are often forgotten in the code; it might be better to use a dedicated issue tracker.
Loading history...
441
				if ( $content_width )
442
					$image_width = $content_width - 10;
443
				else
444
					$image_width = $image_dims[1] - 10;
445
446
				$post_content = '<a href="' . esc_attr( $image_src ) .'"><img src="' . esc_attr( $image_src ) . '?w=' . esc_attr( $image_width ) . '" alt="' . esc_attr( $_FILES['image_0']['name'] ) . '" class="size-full wp-image alignnone" id="i-' . esc_attr( $image_id ) . '" data-filename="' . esc_attr( $_FILES['image_0']['name'] ) . '" /></a>';
447
			}
448
			else {
449
				$post_content = '[gallery ids="' . esc_attr( implode( ',', $image_id_arr ) ) . '"]';
450
			}
451
452
			// Create a new post with the image(s)
453
			$post_id = wp_insert_post( array(
454
					'post_content' => $post_content,
455
					'post_type' => 'jetpack-comic',
456
					'post_status' => 'draft',
457
				),
458
				true
459
			);
460
461
			if ( is_wp_error( $post_id, 'WP_Error' ) ) {
462
				// Failed to create the post.
463
				$rv = array( 'error' => $post_id->get_error_message() );
464
465
				// Delete the uploaded images.
466
				foreach ( $image_id_arr as $image_id ) {
467
					wp_delete_post( $image_id, true );
468
				}
469
			}
470
			else {
471
				foreach ( $image_id_arr as $image_id ) {
472
					wp_update_post( array(
473
						'ID' => $image_id,
474
						'post_parent' => $post_id
475
					) );
476
				}
477
478
				if ( current_theme_supports( 'post-thumbnails' ) && count( $image_id_arr ) == 1 )
479
					set_post_thumbnail( $post_id, $image_id_arr[0] );
480
481
				$rv = array( 'url' => add_query_arg( array( 'post' => $post_id, 'action' => 'edit' ), admin_url( 'post.php' ) ) );
482
			}
483
		}
484
485
		die( json_encode( $rv ) );
0 ignored issues
show
Coding Style Compatibility introduced by
The method upload() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
486
	}
487
488
	public function add_posts_to_loop( $query ) {
489
		// Add comic posts to the tag and category pages.
490
		if ( ! is_admin() && $query->is_main_query() && ( $query->is_category() || $query->is_tag() ) ) {
491
			$post_types = $query->get( 'post_type' );
492
493
			if ( ! $post_types || 'post' == $post_types )
494
				$post_types = array( 'post', self::POST_TYPE );
495
			else if ( is_array( $post_types ) )
496
				$post_types[] = self::POST_TYPE;
497
498
			$query->set( 'post_type', $post_types );
499
		}
500
501
		return $query;
502
	}
503
504
	/**
505
	 * Add to REST API post type whitelist
506
	 */
507
	public function allow_rest_api_type( $post_types ) {
508
		$post_types[] = self::POST_TYPE;
509
		return $post_types;
510
	}
511
512
}
513
514
add_action( 'init', array( 'Jetpack_Comic', 'init' ) );
515
516
517
function comics_welcome_email( $welcome_email, $blog_id, $user_id, $password, $title, $meta ) {
0 ignored issues
show
Unused Code introduced by
The parameter $user_id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $password is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $title is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
518
	if ( ( isset( $meta['vertical'] ) && 'comics' == $meta['vertical'] ) || has_blog_sticker( 'vertical-comics', $blog_id ) ) {
519
		return __( "Welcome! Ready to publish your first strip?
520
521
Your webcomic's new site is ready to go. Get started by <a href=\"BLOG_URLwp-admin/customize.php#title\">setting your comic's title and tagline</a> so your readers know what it's all about.
522
523
Looking for more help with setting up your site? Check out the WordPress.com <a href=\"http://learn.wordpress.com/\">beginner's tutorial</a> and the <a href=\"http://en.support.wordpress.com/comics/\">guide to comics on WordPress.com</a>. Dive right in by <a href=\"BLOG_URLwp-admin/customize.php#title\">publishing your first strip!</a>
524
525
Lots of laughs,
526
The WordPress.com Team", 'jetpack' );
527
	}
528
529
	return $welcome_email;
530
}
531
532
add_filter( 'update_welcome_email_pre_replacement', 'comics_welcome_email', 10, 6 );
533