wphooks.info - enable_post_by_email_configuration

enable_post_by_email_configuration

(trunk - 5.0-alpha-42993)

The hook occurs in the following 4 files

/wp-mail.php:
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
 * a WordPress post. Mailbox connection information must be
 * configured under Settings > Writing
 *
 * @package WordPress
 */

/** Make sure that the WordPress bootstrap has run before continuing. */
require( dirname( __FILE__ ) . '/wp-load.php' );

/** This filter is documented in wp-admin/options.php */
if ( ! apply_filters( 'enable_post_by_email_configuration', true ) ) {
	wp_die( __( 'This action has been disabled by the administrator.' ), 403 );
}

$mailserver_url = get_option( 'mailserver_url' );

if ( 'mail.example.com' === $mailserver_url || empty( $mailserver_url ) ) {
	wp_die( __( 'This action has been disabled by the administrator.' ), 403 );
}
wp-admin/options-writing.php:
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
get_current_screen()->add_help_tab(
	array(
		'id'      => 'overview',
		'title'   => __( 'Overview' ),
		'content' => '<p>' . __( 'You can submit content in several different ways; this screen holds the settings for all of them. The top section controls the editor within the dashboard, while the rest control external publishing methods. For more information on any of these methods, use the documentation links.' ) . '</p>' .
			'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
	)
);

/** This filter is documented in wp-admin/options.php */
if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
	get_current_screen()->add_help_tab(
		array(
			'id'      => 'options-postemail',
			'title'   => __( 'Post Via Email' ),
			'content' => '<p>' . __( 'Post via email settings allow you to send your WordPress installation an email with the content of your post. You must set up a secret email account with POP3 access to use this, and any mail received at this address will be posted, so it&#8217;s a good idea to keep this address very secret.' ) . '</p>',
		)
	);
}
wp-admin/options.php:
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
		$whitelist_options['media'][] = 'upload_url_path';
	}
} else {
	/**
	 * Filters whether the post-by-email functionality is enabled.
	 *
	 * @since 3.0.0
	 *
	 * @param bool $enabled Whether post-by-email configuration is enabled. Default true.
	 */
	if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
		$whitelist_options['writing'] = array_merge( $whitelist_options['writing'], $mail_options );
	}
}

/**
 * Filters the options white list.
 *
 * @since 2.7.0
 *
wp-admin/options-writing.php:
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?php endif; ?>

<?php
do_settings_fields( 'writing', 'default' );
do_settings_fields( 'writing', 'remote_publishing' ); // A deprecated section.
?>
</table>

<?php
/** This filter is documented in wp-admin/options.php */
if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
?>
<h2 class="title"><?php _e( 'Post via email' ); ?></h2>
<p>
<?php
printf(
	/* translators: 1, 2, 3: examples of random email addresses */
	__( 'To post to WordPress by email you must set up a secret email account with POP3 access. Any mail received at this address will be posted, so it&#8217;s a good idea to keep this address very secret. Here are three random strings you could use: %1$s, %2$s, %3$s.' ),
	sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ),
	sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ),