diff --git a/admin/em-admin.php b/admin/em-admin.php index 6c38254..e4b0b0d 100644 --- a/admin/em-admin.php +++ b/admin/em-admin.php @@ -256,25 +256,44 @@ function em_updates_check( $transient ) { //only bother if we're checking for dev versions if( get_option('em_check_dev_version') || get_option('dbem_pro_dev_updates') ){ - //check WP repo for trunk version - $request = wp_remote_get('https://plugins.svn.wordpress.org/events-manager/trunk/events-manager.php'); - - if( !is_wp_error($request) ){ - preg_match('/Version: ([0-9a-z\.]+)/', $request['body'], $matches); - - if( !empty($matches[1]) ){ - //we have a version number! - if( version_compare($transient->checked[EM_SLUG], $matches[1]) < 0) { - $response = new stdClass(); - $response->slug = EM_SLUG; - $response->new_version = $matches[1] ; - $response->url = 'http://wordpress.org/extend/plugins/events-manager/'; - $response->package = 'http://downloads.wordpress.org/plugin/events-manager.zip'; - $transient->response[EM_SLUG] = $response; + //check WP repo for trunk version, other EM-related plugins on .org can hook here to make the best of our admin setting option + $plugins = apply_filters('em_org_dev_versions', array( + 'events-manager'=> array( + 'slug' => EM_SLUG, + 'version' => EM_VERSION + ) + )); + foreach( $plugins as $org_slug => $plugin_info ) { + $request = wp_remote_get('https://plugins.svn.wordpress.org/'.$org_slug.'/trunk/'.$org_slug.'.php'); + $wp_slug = $plugin_info['slug']; + if( empty($transient->checked[$wp_slug]) ){ + $transient->checked[$wp_slug] = !empty($plugin_info['version']) ? $plugin_info['version'] : 0; + } + if (!is_wp_error($request)) { + preg_match('/Version: ([0-9a-z\.]+)/', $request['body'], $matches); + + if (!empty($matches[1])) { + //we have a version number! + $response = new stdClass(); + $response->slug = $wp_slug; + $response->new_version = $matches[1]; + $response->url = 'http://wordpress.org/extend/plugins/'.$org_slug.'/'; + $response->package = 'http://downloads.wordpress.org/plugin/'.$org_slug.'.zip'; + $icon_test = wp_remote_get('https://ps.w.org/'.$org_slug.'/assets/icon-128x128.png'); + if( !is_wp_error($icon_test) && $icon_test['response']['code'] == 200 ){ + $response->icons = array( + '1x' => 'https://ps.w.org/'.$org_slug.'/assets/icon-128x128.png', + '2x' => 'https://ps.w.org/'.$org_slug.'/assets/icon-256x256.png' + ); + } + if ( version_compare($transient->checked[$wp_slug], $matches[1]) < 0) { + $transient->response[$wp_slug] = $response; + }else{ + $transient->no_update[$wp_slug] = $response; + } } } - } - + } delete_option('em_check_dev_version'); } diff --git a/admin/em-bookings.php b/admin/em-bookings.php index ebbc356..57b74e9 100644 --- a/admin/em-bookings.php +++ b/admin/em-bookings.php @@ -186,6 +186,7 @@ function em_bookings_single(){

@@ -239,11 +240,11 @@ function em_bookings_single(){ +

diff --git a/admin/em-docs.php b/admin/em-docs.php index a2edacd..5c6a36a 100644 --- a/admin/em-docs.php +++ b/admin/em-docs.php @@ -170,7 +170,7 @@ function em_docs_init($force_init = false){ 'desc' => 'These placeholders will only show if bookings are enabled for the given event and in the events manager settings page. Spaces placeholders will default to 0', 'placeholders' => array( '#_BOOKINGFORM' => array( 'desc' => 'Adds a booking forms for this event.' ), - '#_BOOKINGBUTTON' => array( 'desc' => 'A single button that will appear to logged in users, if they click on it, they apply for a booking. This button will only display if there is one ticket.' ), + '#_BOOKINGBUTTON' => array( 'desc' => 'A single button that will appear to logged in users, if they click on it a booking will be made. This button will automatically book the first aailable ticket if more than one ticket exists for the event, and will also circumvent any payment requirements. Use in combination with conditional placeholders such as is_free to avoid unpaid bookings.' ), '#_AVAILABLESPACES' => array( 'desc' => 'Shows available spaces for the event.' ), '#_BOOKEDSPACES' => array( 'desc' => 'Shows the amount of currently booked spaces for the event.' ), '#_PENDINGSPACES' => array( 'desc' => 'Shows the amount of pending spaces for the event.' ), diff --git a/admin/em-ms-options.php b/admin/em-ms-options.php index 8bad0b0..1e5deba 100755 --- a/admin/em-ms-options.php +++ b/admin/em-ms-options.php @@ -84,7 +84,7 @@ function em_ms_admin_options_page() {