Changeset 13892
- Timestamp:
- 06/02/2024 01:16:13 AM (4 months ago)
- Location:
- trunk/src/bp-core
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-customizer-email.php
r13878 r13892 23 23 } 24 24 25 $wp_customize->add_panel( 'bp_mailtpl', array( 26 'description' => __( 'Customize the appearance of emails sent by BuddyPress.', 'buddypress' ), 27 'title' => _x( 'BuddyPress Emails', 'screen heading', 'buddypress' ), 28 ) ); 25 $wp_customize->add_panel( 26 'bp_mailtpl', 27 array( 28 'description' => __( 'Customize the appearance of emails sent by BuddyPress.', 'buddypress' ), 29 'title' => _x( 'BuddyPress Emails', 'screen heading', 'buddypress' ), 30 ) 31 ); 29 32 30 33 $sections = bp_email_get_customizer_sections(); … … 126 129 * @param array $sections Email Customizer sections to add. 127 130 */ 128 return apply_filters( 'bp_email_get_customizer_sections', array( 129 'section_bp_mailtpl_header' => array( 130 'capability' => 'bp_moderate', 131 'panel' => 'bp_mailtpl', 132 'title' => _x( 'Header', 'email', 'buddypress' ), 133 ), 134 'section_bp_mailtpl_body' => array( 135 'capability' => 'bp_moderate', 136 'panel' => 'bp_mailtpl', 137 'title' => _x( 'Body', 'email', 'buddypress' ), 138 ), 139 'section_bp_mailtpl_footer' => array( 140 'capability' => 'bp_moderate', 141 'panel' => 'bp_mailtpl', 142 'title' => _x( 'Footer', 'email', 'buddypress' ), 143 ), 144 ) ); 131 return apply_filters( 132 'bp_email_get_customizer_sections', 133 array( 134 'section_bp_mailtpl_header' => array( 135 'capability' => 'bp_moderate', 136 'panel' => 'bp_mailtpl', 137 'title' => _x( 'Header', 'email', 'buddypress' ), 138 ), 139 'section_bp_mailtpl_body' => array( 140 'capability' => 'bp_moderate', 141 'panel' => 'bp_mailtpl', 142 'title' => _x( 'Body', 'email', 'buddypress' ), 143 ), 144 'section_bp_mailtpl_footer' => array( 145 'capability' => 'bp_moderate', 146 'panel' => 'bp_mailtpl', 147 'title' => _x( 'Footer', 'email', 'buddypress' ), 148 ), 149 ) 150 ); 145 151 } 146 152 … … 162 168 * @param array $settings Email Customizer settings to add. 163 169 */ 164 return apply_filters( 'bp_email_get_customizer_settings', array( 165 'bp_email_options[email_bg]' => array( 166 'capability' => 'bp_moderate', 167 'default' => $defaults['email_bg'], 168 'sanitize_callback' => 'sanitize_hex_color', 169 'transport' => 'postMessage', 170 'type' => 'option', 171 ), 172 'bp_email_options[header_bg]' => array( 173 'capability' => 'bp_moderate', 174 'default' => $defaults['header_bg'], 175 'sanitize_callback' => 'sanitize_hex_color', 176 'transport' => 'postMessage', 177 'type' => 'option', 178 ), 179 'bp_email_options[header_text_size]' => array( 180 'capability' => 'bp_moderate', 181 'default' => $defaults['header_text_size'], 182 'sanitize_callback' => 'absint', 183 'transport' => 'postMessage', 184 'type' => 'option', 185 ), 186 'bp_email_options[header_text_color]' => array( 187 'capability' => 'bp_moderate', 188 'default' => $defaults['header_text_color'], 189 'sanitize_callback' => 'sanitize_hex_color', 190 'transport' => 'postMessage', 191 'type' => 'option', 192 ), 193 'bp_email_options[highlight_color]' => array( 194 'capability' => 'bp_moderate', 195 'default' => $defaults['highlight_color'], 196 'sanitize_callback' => 'sanitize_hex_color', 197 'transport' => 'postMessage', 198 'type' => 'option', 199 ), 200 'bp_email_options[body_bg]' => array( 201 'capability' => 'bp_moderate', 202 'default' => $defaults['body_bg'], 203 'sanitize_callback' => 'sanitize_hex_color', 204 'transport' => 'postMessage', 205 'type' => 'option', 206 ), 207 'bp_email_options[body_text_size]' => array( 208 'capability' => 'bp_moderate', 209 'default' => $defaults['body_text_size'], 210 'sanitize_callback' => 'absint', 211 'transport' => 'postMessage', 212 'type' => 'option', 213 ), 214 'bp_email_options[body_text_color]' => array( 215 'capability' => 'bp_moderate', 216 'default' => $defaults['body_text_color'], 217 'sanitize_callback' => 'sanitize_hex_color', 218 'transport' => 'postMessage', 219 'type' => 'option', 220 ), 221 'bp_email_options[footer_text]' => array( 222 'capability' => 'bp_moderate', 223 'default' => $defaults['footer_text'], 224 'sanitize_callback' => 'wp_filter_post_kses', 225 'transport' => 'postMessage', 226 'type' => 'option', 227 ), 228 'bp_email_options[footer_bg]' => array( 229 'capability' => 'bp_moderate', 230 'default' => $defaults['footer_bg'], 231 'sanitize_callback' => 'sanitize_hex_color', 232 'transport' => 'postMessage', 233 'type' => 'option', 234 ), 235 'bp_email_options[footer_text_size]' => array( 236 'capability' => 'bp_moderate', 237 'default' => $defaults['footer_text_size'], 238 'sanitize_callback' => 'absint', 239 'transport' => 'postMessage', 240 'type' => 'option', 241 ), 242 'bp_email_options[footer_text_color]' => array( 243 'capability' => 'bp_moderate', 244 'default' => $defaults['footer_text_color'], 245 'sanitize_callback' => 'sanitize_hex_color', 246 'transport' => 'postMessage', 247 'type' => 'option', 248 ), 249 ) ); 170 return apply_filters( 171 'bp_email_get_customizer_settings', 172 array( 173 'bp_email_options[email_bg]' => array( 174 'capability' => 'bp_moderate', 175 'default' => $defaults['email_bg'], 176 'sanitize_callback' => 'sanitize_hex_color', 177 'transport' => 'postMessage', 178 'type' => 'option', 179 ), 180 'bp_email_options[header_bg]' => array( 181 'capability' => 'bp_moderate', 182 'default' => $defaults['header_bg'], 183 'sanitize_callback' => 'sanitize_hex_color', 184 'transport' => 'postMessage', 185 'type' => 'option', 186 ), 187 'bp_email_options[header_text_size]' => array( 188 'capability' => 'bp_moderate', 189 'default' => $defaults['header_text_size'], 190 'sanitize_callback' => 'absint', 191 'transport' => 'postMessage', 192 'type' => 'option', 193 ), 194 'bp_email_options[header_text_color]' => array( 195 'capability' => 'bp_moderate', 196 'default' => $defaults['header_text_color'], 197 'sanitize_callback' => 'sanitize_hex_color', 198 'transport' => 'postMessage', 199 'type' => 'option', 200 ), 201 'bp_email_options[highlight_color]' => array( 202 'capability' => 'bp_moderate', 203 'default' => $defaults['highlight_color'], 204 'sanitize_callback' => 'sanitize_hex_color', 205 'transport' => 'postMessage', 206 'type' => 'option', 207 ), 208 'bp_email_options[body_bg]' => array( 209 'capability' => 'bp_moderate', 210 'default' => $defaults['body_bg'], 211 'sanitize_callback' => 'sanitize_hex_color', 212 'transport' => 'postMessage', 213 'type' => 'option', 214 ), 215 'bp_email_options[body_text_size]' => array( 216 'capability' => 'bp_moderate', 217 'default' => $defaults['body_text_size'], 218 'sanitize_callback' => 'absint', 219 'transport' => 'postMessage', 220 'type' => 'option', 221 ), 222 'bp_email_options[body_text_color]' => array( 223 'capability' => 'bp_moderate', 224 'default' => $defaults['body_text_color'], 225 'sanitize_callback' => 'sanitize_hex_color', 226 'transport' => 'postMessage', 227 'type' => 'option', 228 ), 229 'bp_email_options[footer_text]' => array( 230 'capability' => 'bp_moderate', 231 'default' => $defaults['footer_text'], 232 'sanitize_callback' => 'wp_filter_post_kses', 233 'transport' => 'postMessage', 234 'type' => 'option', 235 ), 236 'bp_email_options[footer_bg]' => array( 237 'capability' => 'bp_moderate', 238 'default' => $defaults['footer_bg'], 239 'sanitize_callback' => 'sanitize_hex_color', 240 'transport' => 'postMessage', 241 'type' => 'option', 242 ), 243 'bp_email_options[footer_text_size]' => array( 244 'capability' => 'bp_moderate', 245 'default' => $defaults['footer_text_size'], 246 'sanitize_callback' => 'absint', 247 'transport' => 'postMessage', 248 'type' => 'option', 249 ), 250 'bp_email_options[footer_text_color]' => array( 251 'capability' => 'bp_moderate', 252 'default' => $defaults['footer_text_color'], 253 'sanitize_callback' => 'sanitize_hex_color', 254 'transport' => 'postMessage', 255 'type' => 'option', 256 ), 257 ) 258 ); 250 259 } 251 260 … … 266 275 * @param array $controls Email Customizer controls to add. 267 276 */ 268 return apply_filters( 'bp_email_get_customizer_controls', array(269 'bp_ mailtpl_email_bg' => array(270 'class' => 'WP_Customize_Color_Control',271 ' label' => __( 'Email background color', 'buddypress' ),272 'section' => 'section_bp_mailtpl_header',273 'settings' => 'bp_email_options[email_bg]',274 ),275 276 'bp_mailtpl_header_bg' => array(277 'class' => 'WP_Customize_Color_Control', 278 ' label' => __( 'Header background color', 'buddypress' ),279 'section' => 'section_bp_mailtpl_header',280 'settings' => 'bp_email_options[header_bg]',281 ),282 283 'bp_mailtpl_highlight_color' => array(284 'class' => 'WP_Customize_Color_Control', 285 ' description' => __( 'Applied to links and other decorative areas.', 'buddypress' ),286 'label' => __( 'Highlight color', 'buddypress' ),287 'section' => 'section_bp_mailtpl_header',288 'settings' => 'bp_email_options[highlight_color]',289 ),290 291 'bp_mailtpl_header_text_color' => array(292 'class' => 'WP_Customize_Color_Control', 293 ' label' => __( 'Text color', 'buddypress' ),294 'section' => 'section_bp_mailtpl_header',295 'settings' => 'bp_email_options[header_text_color]',296 ),297 298 'bp_mailtpl_header_text_size' => array(299 'class' => 'BP_Customizer_Control_Range', 300 ' label' => __( 'Text size', 'buddypress' ),301 'section' => 'section_bp_mailtpl_header',302 'settings' => 'bp_email_options[header_text_size]',303 304 'input_attrs' => array(305 'max' => 100, 306 ' min' => 1,307 'step' => 1,308 ),309 ),310 311 312 'bp_mailtpl_body_bg' => array( 313 ' class' => 'WP_Customize_Color_Control',314 'label' => __( 'Background color', 'buddypress' ),315 'section' => 'section_bp_mailtpl_body',316 'settings' => 'bp_email_options[body_bg]',317 ),318 319 320 'bp_mailtpl_body_text_color'=> array(321 'class' => 'WP_Customize_Color_Control',322 'label' => __( 'Text color', 'buddypress' ),323 'section' => 'section_bp_mailtpl_body',324 'settings' => 'bp_email_options[body_text_color]',325 ),326 327 'bp_mailtpl_body_text_size'=> array(328 'class'=> 'BP_Customizer_Control_Range',329 'label'=> __( 'Text size', 'buddypress' ),330 'section'=> 'section_bp_mailtpl_body',331 'settings'=> 'bp_email_options[body_text_size]',332 333 'input_attrs' => array(334 'max' => 24,335 'min' => 8,336 'step' => 1,337 ),338 ),339 340 341 'bp_mailtpl_footer_text' => array(342 'class' => 'WP_Customize_Control',343 'description' => __('Change the email footer here', 'buddypress' ),344 'label' => __( 'Footer text', 'buddypress' ),345 'section' => 'section_bp_mailtpl_footer',346 'settings' => 'bp_email_options[footer_text]',347 'type' => 'textarea',348 ), 349 350 'bp_mailtpl_footer_bg' => array(351 'class' => 'WP_Customize_Color_Control',352 'label' => __( 'Background color', 'buddypress' ),353 'section' => 'section_bp_mailtpl_footer',354 'settings' => 'bp_email_options[footer_bg]',355 ), 356 357 'bp_mailtpl_footer_text_color' => array(358 'class' => 'WP_Customize_Color_Control',359 'label' => __( 'Text color', 'buddypress' ),360 'section' => 'section_bp_mailtpl_footer',361 'settings' => 'bp_email_options[footer_text_color]',362 ), 363 364 'bp_mailtpl_footer_text_size' => array(365 'class' => 'BP_Customizer_Control_Range',366 'label' => __( 'Text size', 'buddypress' ),367 'section' => 'section_bp_mailtpl_footer',368 'settings' => 'bp_email_options[footer_text_size]', 369 370 'input_attrs' => array(371 'max' => 24,372 'min' => 8,373 'step' => 1,374 ), 375 ) ,376 ) );277 return apply_filters( 278 'bp_email_get_customizer_controls', 279 array( 280 'bp_mailtpl_email_bg' => array( 281 'class' => 'WP_Customize_Color_Control', 282 'label' => __( 'Email background color', 'buddypress' ), 283 'section' => 'section_bp_mailtpl_header', 284 'settings' => 'bp_email_options[email_bg]', 285 ), 286 287 'bp_mailtpl_header_bg' => array( 288 'class' => 'WP_Customize_Color_Control', 289 'label' => __( 'Header background color', 'buddypress' ), 290 'section' => 'section_bp_mailtpl_header', 291 'settings' => 'bp_email_options[header_bg]', 292 ), 293 294 'bp_mailtpl_highlight_color' => array( 295 'class' => 'WP_Customize_Color_Control', 296 'description' => __( 'Applied to links and other decorative areas.', 'buddypress' ), 297 'label' => __( 'Highlight color', 'buddypress' ), 298 'section' => 'section_bp_mailtpl_header', 299 'settings' => 'bp_email_options[highlight_color]', 300 ), 301 302 'bp_mailtpl_header_text_color' => array( 303 'class' => 'WP_Customize_Color_Control', 304 'label' => __( 'Text color', 'buddypress' ), 305 'section' => 'section_bp_mailtpl_header', 306 'settings' => 'bp_email_options[header_text_color]', 307 ), 308 309 'bp_mailtpl_header_text_size' => array( 310 'class' => 'BP_Customizer_Control_Range', 311 'label' => __( 'Text size', 'buddypress' ), 312 'section' => 'section_bp_mailtpl_header', 313 'settings' => 'bp_email_options[header_text_size]', 314 315 'input_attrs' => array( 316 'max' => 100, 317 'min' => 1, 318 'step' => 1, 319 ), 320 ), 321 322 'bp_mailtpl_body_bg' => array( 323 'class' => 'WP_Customize_Color_Control', 324 'label' => __( 'Background color', 'buddypress' ), 325 'section' => 'section_bp_mailtpl_body', 326 'settings' => 'bp_email_options[body_bg]', 327 ), 328 329 'bp_mailtpl_body_text_color' => array( 330 'class' => 'WP_Customize_Color_Control', 331 'label' => __( 'Text color', 'buddypress' ), 332 'section' => 'section_bp_mailtpl_body', 333 'settings' => 'bp_email_options[body_text_color]', 334 ), 335 336 'bp_mailtpl_body_text_size' => array( 337 'class' => 'BP_Customizer_Control_Range', 338 'label' => __( 'Text size', 'buddypress' ), 339 'section' => 'section_bp_mailtpl_body', 340 'settings' => 'bp_email_options[body_text_size]', 341 342 'input_attrs' => array( 343 'max' => 24, 344 'min' => 8, 345 'step' => 1, 346 ), 347 ), 348 349 'bp_mailtpl_footer_text' => array( 350 'class' => 'WP_Customize_Control', 351 'description' => __( 'Change the email footer here', 'buddypress' ), 352 'label' => __( 'Footer text', 'buddypress' ), 353 'section' => 'section_bp_mailtpl_footer', 354 'settings' => 'bp_email_options[footer_text]', 355 'type' => 'textarea', 356 ), 357 358 'bp_mailtpl_footer_bg' => array( 359 'class' => 'WP_Customize_Color_Control', 360 'label' => __( 'Background color', 'buddypress' ), 361 'section' => 'section_bp_mailtpl_footer', 362 'settings' => 'bp_email_options[footer_bg]', 363 ), 364 365 'bp_mailtpl_footer_text_color' => array( 366 'class' => 'WP_Customize_Color_Control', 367 'label' => __( 'Text color', 'buddypress' ), 368 'section' => 'section_bp_mailtpl_footer', 369 'settings' => 'bp_email_options[footer_text_color]', 370 ), 371 372 'bp_mailtpl_footer_text_size' => array( 373 'class' => 'BP_Customizer_Control_Range', 374 'label' => __( 'Text size', 'buddypress' ), 375 'section' => 'section_bp_mailtpl_footer', 376 'settings' => 'bp_email_options[footer_text_size]', 377 378 'input_attrs' => array( 379 'max' => 24, 380 'min' => 8, 381 'step' => 1, 382 ), 383 ), 384 ) 385 ); 377 386 } 378 387 … … 391 400 } 392 401 393 $email = get_posts( array( 394 'fields' => 'ids', 395 'orderby' => 'rand', 396 'post_status' => 'publish', 397 'post_type' => bp_get_email_post_type(), 398 'posts_per_page' => 1, 399 'suppress_filters' => false, 400 ) ); 402 $email = get_posts( 403 array( 404 'fields' => 'ids', 405 'orderby' => 'rand', 406 'post_status' => 'publish', 407 'post_type' => bp_get_email_post_type(), 408 'posts_per_page' => 1, 409 'suppress_filters' => false, 410 ) 411 ); 401 412 402 413 $preview_url = admin_url(); -
trunk/src/bp-core/classes/class-bp-email-address.php
r12353 r13892 3 3 * Interface for objects that have email address properties (address, name). 4 4 * 5 * @since 5.0.0 5 * @package BuddyPress 6 * @subpackage Core 6 7 */ 7 8 9 // Exit if accessed directly. 10 defined( 'ABSPATH' ) || exit; 11 12 /** 13 * BP_Email_Address Interface. 14 * 15 * @since 2.5.0 16 */ 8 17 interface BP_Email_Address { 18 9 19 /** 10 20 * Gets the email address of the user. 11 21 * 12 22 * @since 5.0.0 23 * 24 * @return string 13 25 */ 14 26 public function get_address(); … … 18 30 * 19 31 * @since 5.0.0 32 * 33 * @return string 20 34 */ 21 35 public function get_name(); -
trunk/src/bp-core/classes/class-bp-email-delivery.php
r10470 r13892 1 1 <?php 2 2 /** 3 * Core component classes.3 * Email delivery implementation base class. 4 4 * 5 5 * @package BuddyPress … … 7 7 */ 8 8 9 // Exit if accessed directly 9 // Exit if accessed directly. 10 10 defined( 'ABSPATH' ) || exit; 11 11 12 12 /** 13 * Email delivery implementation base class.13 * BP_Email_Delivery Interface. 14 14 * 15 15 * When implementing support for an email delivery service into BuddyPress, -
trunk/src/bp-core/classes/class-bp-email-participant.php
r12353 r13892 4 4 * 5 5 * @since 5.0.0 6 * 7 * @package BuddyPress 8 * @subpackage Core 6 9 */ 7 10 11 // Exit if accessed directly. 12 defined( 'ABSPATH' ) || exit; 13 14 /** 15 * BP_Email_Participant class. 16 * 17 * @since 5.0.0 18 */ 8 19 abstract class BP_Email_Participant implements BP_Email_Address { 20 9 21 /** 10 22 * Recipient's email address. … … 29 41 * 30 42 * @since 5.0.0 43 * 44 * @return string 31 45 */ 32 46 public function get_address() { -
trunk/src/bp-core/classes/class-bp-email-recipient.php
r13372 r13892 1 1 <?php 2 2 /** 3 * Core component classes. 3 * BuddyPress Email Recipient class. 4 * 5 * Represents a recipient that an email will be sent to. 4 6 * 5 7 * @package BuddyPress … … 7 9 */ 8 10 9 // Exit if accessed directly 11 // Exit if accessed directly. 10 12 defined( 'ABSPATH' ) || exit; 11 13 12 14 /** 13 * Represents a recipient that an email will be sent to.15 * BP_Email_Recipient class. 14 16 * 15 17 * @since 2.5.0 … … 22 24 * @since 2.5.0 23 25 * 24 * @var WP_User 26 * @var WP_User|null 25 27 */ 26 28 protected $user_object = null; … … 45 47 $this->user_object = $email_or_user; 46 48 47 // Query for WP user by user ID.49 // Query for WP user by user ID. 48 50 } elseif ( is_int( $email_or_user ) ) { 49 51 $this->user_object = get_user_by( 'id', $email_or_user ); … … 55 57 } 56 58 57 // Array or miscellaneous string.59 // Array or miscellaneous string. 58 60 } else { 59 61 if ( ! is_array( $email_or_user ) ) { … … 82 84 // We have a user object; so set address and name from DB. 83 85 if ( $this->user_object ) { 84 // This is escaped with esc_html in bp_core_get_user_displayname() 86 // This is escaped with esc_html in bp_core_get_user_displayname(). 85 87 $wp_name = wp_specialchars_decode( bp_core_get_user_displayname( $this->user_object->ID ), ENT_QUOTES ); 86 88 -
trunk/src/bp-core/classes/class-bp-email-sender.php
r12353 r13892 4 4 * 5 5 * @since 5.0.0 6 * 7 * @package BuddyPress 8 * @subpackage Core 6 9 */ 7 10 11 // Exit if accessed directly. 12 defined( 'ABSPATH' ) || exit; 13 14 /** 15 * BP_Email_Sender class. 16 */ 8 17 class BP_Email_Sender extends BP_Email_Participant {} -
trunk/src/bp-core/classes/class-bp-email.php
r13372 r13892 1 1 <?php 2 2 /** 3 * Core component classes.3 * Represents an email that will be sent to member(s). 4 4 * 5 5 * @package BuddyPress … … 7 7 */ 8 8 9 // Exit if accessed directly 9 // Exit if accessed directly. 10 10 defined( 'ABSPATH' ) || exit; 11 11 12 12 /** 13 * Represents an email that will be sent to member(s).13 * BP_Email class. 14 14 * 15 15 * @since 2.5.0 16 16 */ 17 17 class BP_Email { 18 18 19 /** 19 20 * Addressee details (BCC). … … 66 67 * @since 2.5.0 67 68 * 68 * @var BP_Email_Sender Sender details.69 * @var BP_Email_Sender 69 70 */ 70 71 protected $from = null; … … 82 83 * Email headers. 83 84 * 84 * @since 2.5.0 85 * 86 * @var string[] Associative pairing of email header name/value. 85 * Associative pairing of email header name/value. 86 * 87 * @since 2.5.0 88 * 89 * @var string[] 87 90 */ 88 91 protected $headers = array(); … … 93 96 * @since 2.5.0 94 97 * 95 * @var WP_Post 98 * @var WP_Post|null 96 99 */ 97 100 protected $post_object = null; … … 102 105 * @since 2.5.0 103 106 * 104 * @var BP_Email_Sender "Reply to" details.107 * @var BP_Email_Sender|null 105 108 */ 106 109 protected $reply_to = null; … … 146 149 * Token names and replacement values for this email. 147 150 * 148 * @since 2.5.0 149 * 150 * @var string[] Associative pairing of token name (key) and replacement value (value). 151 * Associative pairing of token name (key) and replacement value (value). 152 * 153 * @since 2.5.0 154 * 155 * @var string[] 151 156 */ 152 157 protected $tokens = array(); … … 170 175 $domain = substr( $domain, 4 ); 171 176 } 172 173 177 } elseif ( function_exists( 'gethostname' ) && gethostname() !== false ) { 174 178 $domain = gethostname(); … … 205 209 } 206 210 207 208 211 /* 209 212 * Setters/getters. … … 228 231 $property_name = 'content_' . $this->get_content_type(); 229 232 230 if ( ! in_array( $property_name, array( 'content_html', 'content_plaintext' ,), true ) ) {233 if ( ! in_array( $property_name, array( 'content_html', 'content_plaintext' ), true ) ) { 231 234 $property_name = 'content_html'; 232 235 } … … 236 239 return null; 237 240 } 238 239 241 240 242 /** … … 273 275 * @since 2.5.0 274 276 * 275 * @param string$retval Property value.277 * @param mixed $retval Property value. 276 278 * @param string $property_name Property name. 277 279 * @param string $transform How to transform the return value. … … 286 288 * 287 289 * @since 4.0.0 290 * 291 * @return string 288 292 */ 289 293 public function get_preheader() { … … 444 448 * @since 2.5.0 445 449 * 446 * @return WP_Post The post. 450 * @param string $transform Optional. How to transform the return value. Defaults to 'raw'. 451 * @return WP_Post|null WP_Post object, or null if not set. 447 452 */ 448 453 public function get_post_object( $transform = 'raw' ) { … … 459 464 * @param string $transform Optional. How to transform the return value. 460 465 * Accepts 'raw' (default) or 'replace-tokens'. 461 * @return BP_Email_Recipient "Reply to" recipient.466 * @return BP_Email_Recipient|null "Reply to" recipient, or null if not set. 462 467 */ 463 468 public function get_reply_to( $transform = 'raw' ) { … … 474 479 * @param string $transform Optional. How to transform the return value. 475 480 * Accepts 'raw' (default) or 'replace-tokens'. 476 * @return string Email subject.481 * @return string|null Email subject, or null if not set. 477 482 */ 478 483 public function get_subject( $transform = 'raw' ) { … … 489 494 * @param string $transform Optional. How to transform the return value. 490 495 * Accepts 'raw' (default) or 'replace-tokens'. 491 * @return string Email template. Assumed to be HTML.496 * @return string|null Email template. Assumed to be HTML. Or null if not set. 492 497 */ 493 498 public function get_template( $transform = 'raw' ) { … … 504 509 * @param string $transform Optional. How to transform the return value. 505 510 * Accepts 'raw' (default) or 'replace-tokens'. 506 * @return BP_Email_Recipient[] "To" recipients.511 * @return BP_Email_Recipient[]|null "To" recipients. Or null if not set. 507 512 */ 508 513 public function get_to( $transform = 'raw' ) { … … 519 524 * @param string $transform Optional. How to transform the return value. 520 525 * Accepts 'raw' (default) or 'replace-tokens'. 521 * @return string[] Associative pairing of token name (key) and replacement value (value). 526 * @return string[]|null Associative pairing of token name (key) and replacement value (value). 527 * Or null if not set. 522 528 */ 523 529 public function get_tokens( $transform = 'raw' ) { … … 571 577 * @param string|array|int|WP_User $bcc_address Either a email address, user ID, WP_User object, 572 578 * or an array containing any combination of the above. 573 * @param string $name Optional. If $bcc_address is a string, this is the recipient's name.574 * @param string $operation Optional. If "replace", $to_address replaces current setting (default).575 * If "add", $to_address is added to the current setting.579 * @param string $name Optional. If $bcc_address is a string, this is the recipient's name. 580 * @param string $operation Optional. If "replace", $to_address replaces current setting (default). 581 * If "add", $to_address is added to the current setting. 576 582 * @return BP_Email 577 583 */ … … 583 589 $bcc[] = new BP_Email_Recipient( $address ); 584 590 } 585 586 591 } else { 587 592 $bcc[] = new BP_Email_Recipient( $bcc_address, $name ); … … 620 625 * @param string|array|int|WP_User $cc_address Either a email address, user ID, WP_User object, 621 626 * or an array containing any combination of the above. 622 * @param string $name Optional. If $cc_address is a string, this is the recipient's name.623 * @param string $operation Optional. If "replace", $to_address replaces current setting (default).624 * If "add", $to_address is added to the current setting.627 * @param string $name Optional. If $cc_address is a string, this is the recipient's name. 628 * @param string $operation Optional. If "replace", $to_address replaces current setting (default). 629 * If "add", $to_address is added to the current setting. 625 630 * @return BP_Email 626 631 */ … … 632 637 $cc[] = new BP_Email_Recipient( $address ); 633 638 } 634 635 639 } else { 636 640 $cc[] = new BP_Email_Recipient( $cc_address, $name ); … … 710 714 */ 711 715 public function set_content_type( $content_type ) { 712 if ( ! in_array( $content_type, array( 'html', 'plaintext' ,), true ) ) {716 if ( ! in_array( $content_type, array( 'html', 'plaintext' ), true ) ) { 713 717 $class = get_class_vars( get_class() ); 714 718 $content_type = $class['content_type']; … … 736 740 * 737 741 * @param string|array|int|WP_User $email_address Either a email address, user ID, or WP_User object. 738 * @param string $name Optional. If $email_address is a string, this is the recipient's name.742 * @param string $name Optional. If $email_address is a string, this is the recipient's name. 739 743 * @return BP_Email 740 744 */ … … 768 772 * @since 2.5.0 769 773 * 770 * @param WP_Post $post 774 * @param WP_Post $post Post object. 771 775 * @return BP_Email 772 776 */ … … 820 824 * @param string|array|int|WP_User $email_address Either a email address, user ID, WP_User object, 821 825 * or an array containing any combination of the above. 822 * @param string $name Optional. If $email_address is a string, this is the recipient's name.826 * @param string $name Optional. If $email_address is a string, this is the recipient's name. 823 827 * @return BP_Email 824 828 */ … … 913 917 * @param string|array|int|WP_User $to_address Either a email address, user ID, WP_User object, 914 918 * or an array containing any combination of the above. 915 * @param string $name Optional. If $to_address is a string, this is the recipient's name.916 * @param string $operation Optional. If "replace", $to_address replaces current setting (default).917 * If "add", $to_address is added to the current setting.919 * @param string $name Optional. If $to_address is a string, this is the recipient's name. 920 * @param string $operation Optional. If "replace", $to_address replaces current setting (default). 921 * If "add", $to_address is added to the current setting. 918 922 * @return BP_Email 919 923 */ … … 925 929 $to[] = new BP_Email_Recipient( $address ); 926 930 } 927 928 931 } else { 929 932 $to[] = new BP_Email_Recipient( $to_address, $name ); … … 982 985 return $this; 983 986 } 984 985 987 986 988 /* -
trunk/src/bp-core/classes/class-bp-phpmailer.php
r13888 r13892 1 1 <?php 2 2 /** 3 * Core component classes.3 * Email delivery implementation using PHPMailer. 4 4 * 5 5 * @package BuddyPress 6 6 * @subpackage Core 7 * 8 * @phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase 9 * @phpcs:disable Generic.CodeAnalysis.EmptyStatement.DetectedCatch 10 * @phpcs:disable Squiz.Commenting.EmptyCatchComment.Missing 7 11 */ 8 12 … … 11 15 12 16 /** 13 * Email delivery implementation using PHPMailer.17 * BP_PHPMailer class. 14 18 * 15 19 * @since 2.5.0 … … 144 148 * 145 149 * @since 2.5.0 150 * 146 151 * @deprecated 2.5.3 No longer used. 147 152 *
Note: See TracChangeset
for help on using the changeset viewer.