Changeset 2320543
- Timestamp:
- 06/09/2020 02:02:43 AM (6 years ago)
- Location:
- sendpress/trunk
- Files:
-
- 3 edited
-
classes/class-sendpress-data.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
sendpress.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sendpress/trunk/classes/class-sendpress-data.php
r2247605 r2320543 1573 1573 1574 1574 1575 static function subscribe_user_to_lists($userarray , $list_ids, $status=2,$custom=array()){ 1576 $defaults = array( 1577 'firstname' => '', 1578 'lastname' => '', 1579 'email' => '', 1580 'phonenumber' => '', 1581 'salutation' => '' 1582 ); 1583 $userarray = wp_parse_args( $userarray, $defaults ); 1584 $success = false; 1585 $subscriberID = SendPress_Data::add_subscriber($userarray); 1586 if( false === $subscriberID ){ 1587 return false; 1588 } 1589 1590 $args = array( 1591 'post_type' => 'sendpress_list', 1592 'numberposts' => -1, 1593 'offset' => 0, 1594 'orderby' => 'post_title', 1595 'order' => 'DESC' 1596 ); 1597 1598 $lists = get_posts( $args ); 1599 1600 $listids = explode(',', $list_ids); 1601 1602 $already_subscribed = false; 1603 1604 foreach($lists as $list){ 1605 if( in_array($list->ID, $listids) ){ 1606 $current_status = SendPress_Data::get_subscriber_list_status( $list->ID, $subscriberID ); 1607 SendPress_Error::log($current_status); 1608 if( empty($current_status) || ( isset($current_status->status) && $current_status->status < 2 ) ){ 1609 $success = SendPress_Data::update_subscriber_status($list->ID, $subscriberID, $status); 1610 } else { 1611 $success = true; 1612 } 1613 if(isset($custom) && is_array($custom) && !empty($custom)){ 1614 foreach ($custom as $key => $value) { 1615 SendPress_Data::update_subscriber_meta( $subscriberID, $key, $value, $list->ID ); 1616 } 1617 } 1618 1619 } 1620 } 1621 1622 if($success == false){ 1623 return false; 1624 } 1625 1626 return array('success'=> $success,'already'=> $already_subscribed); 1627 } 1628 1629 1630 1631 1632 1575 1633 static function subscribe_user($listid, $email, $first, $last, $status = 2, $custom = array(), $phonenumber='', $salutation='') { 1576 1634 -
sendpress/trunk/readme.txt
r2282705 r2320543 5 5 Requires at least: 4.4 6 6 Tested up to: 5.4 7 Stable tag: 1.20. 4.137 Stable tag: 1.20.6.08 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 119 119 Previous releases can be downloaded from [GitHub](https://github.com/brewlabs/sendpress/releases) 120 120 121 1.20.4.13 - 2020.4.13 = 121 = 1.20.6.08 - 2020.6.08 = 122 * Add new subscribe function 123 124 = 1.20.4.13 - 2020.4.13 = 122 125 * fix issue with extra log data in logs 123 126 124 1.20.3.19 - 2020.3.19 =127 = 1.20.3.19 - 2020.3.19 = 125 128 * fix issue with admin area redirect 126 129 -
sendpress/trunk/sendpress.php
r2282705 r2320543 2 2 /* 3 3 Plugin Name: SendPress Newsletters 4 Version: 1.20. 4.134 Version: 1.20.6.08 5 5 Plugin URI: https://sendpress.com 6 6 Description: Easy to manage Newsletters for WordPress. … … 20 20 define( 'SENDPRESS_API_VERSION', 1 ); 21 21 define( 'SENDPRESS_MINIMUM_WP_VERSION', '3.6' ); 22 define( 'SENDPRESS_VERSION', '1.20. 4.13' );22 define( 'SENDPRESS_VERSION', '1.20.6.08' ); 23 23 define( 'SENDPRESS_URL', plugin_dir_url( __FILE__ ) ); 24 24 define( 'SENDPRESS_PATH', plugin_dir_path( __FILE__ ) );
Note: See TracChangeset
for help on using the changeset viewer.