Compare commits
2 Commits
9cbc2cb832
...
19dfd317cc
Author | SHA1 | Date | |
---|---|---|---|
19dfd317cc | |||
e3858f0710 |
@ -1,577 +0,0 @@
|
||||
<?php
|
||||
|
||||
// Event schedules failed
|
||||
if ( !wp_next_scheduled ( 'cau_set_schedule_mail' ) ) {
|
||||
echo '<div id="message" class="error"><p><b>'.__( 'Companion Auto Update was not able to set the event for sending you emails, please re-activate the plugin in order to set the event', 'companion-auto-update' ).'.</b></p></div>';
|
||||
}
|
||||
|
||||
// Database requires an update
|
||||
if ( cau_incorrectDatabaseVersion() ) {
|
||||
echo '<div id="message" class="error"><p><b>'.__( 'Companion Auto Update Database Update', 'companion-auto-update' ).' –</b>
|
||||
'.__( 'We need you to update to the latest database version', 'companion-auto-update' ).'. <a href="'.cau_url( 'status' ).'&run=db_update" class="button button-alt" style="background: #FFF;">'.__( 'Run updater now', 'companion-auto-update' ).'</a></p></div>';
|
||||
}
|
||||
|
||||
// Update log DB is empty
|
||||
if ( cau_updateLogDBisEmpty() ) {
|
||||
echo '<div id="message" class="error"><p><b>'.__( 'Companion Auto Update Database Update', 'companion-auto-update' ).' –</b>
|
||||
'.__( 'We need to add some information to your database', 'companion-auto-update' ).'. <a href="'.cau_url( 'status' ).'&run=db_info_update" class="button button-alt" style="background: #FFF;">'.__( 'Run updater now', 'companion-auto-update' ).'</a></p></div>';
|
||||
}
|
||||
|
||||
// Save settings
|
||||
if( isset( $_POST['submit'] ) ) {
|
||||
|
||||
check_admin_referer( 'cau_save_settings' );
|
||||
|
||||
global $wpdb;
|
||||
$table_name = $wpdb->prefix . "auto_updates";
|
||||
|
||||
// Auto updater
|
||||
$plugins = isset( $_POST['plugins'] ) ? sanitize_text_field( $_POST['plugins'] ) : '';
|
||||
$themes = isset( $_POST['themes'] ) ? sanitize_text_field( $_POST['themes'] ) : '';
|
||||
$minor = isset( $_POST['minor'] ) ? sanitize_text_field( $_POST['minor'] ) : '';
|
||||
$major = isset( $_POST['major'] ) ? sanitize_text_field( $_POST['major'] ) : '';
|
||||
$translations = isset( $_POST['translations'] ) ? sanitize_text_field( $_POST['translations'] ) : '';
|
||||
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'plugins'", $plugins ) );
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'themes'", $themes ) );
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'minor'", $minor ) );
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'major'", $major ) );
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'translations'", $translations ) );
|
||||
|
||||
// Emails
|
||||
$send = isset( $_POST['cau_send'] ) ? sanitize_text_field( $_POST['cau_send'] ) : '';
|
||||
$sendupdate = isset( $_POST['cau_send_update'] ) ? sanitize_text_field( $_POST['cau_send_update'] ) : '';
|
||||
$sendoutdated = isset( $_POST['cau_send_outdated'] ) ? sanitize_text_field( $_POST['cau_send_outdated'] ) : '';
|
||||
$wpemails = isset( $_POST['wpemails'] ) ? sanitize_text_field( $_POST['wpemails'] ) : '';
|
||||
$email = isset( $_POST['cau_email'] ) ? sanitize_text_field( $_POST['cau_email'] ) : '';
|
||||
$html_or_text = isset( $_POST['html_or_text'] ) ? sanitize_text_field( $_POST['html_or_text'] ) : 'html';
|
||||
$dbupdateemails = isset( $_POST['dbupdateemails'] ) ? sanitize_text_field( $_POST['dbupdateemails'] ) : '';
|
||||
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'email'", $email ) );
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'send'", $send ) );
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'sendupdate'", $sendupdate ) );
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'sendoutdated'", $sendoutdated ) );
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'wpemails'", $wpemails ) );
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'html_or_text'", $html_or_text ) );
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'dbupdateemails'", $dbupdateemails ) );
|
||||
|
||||
// Advanced
|
||||
$allow_editor = isset( $_POST['allow_editor'] ) ? sanitize_text_field( $_POST['allow_editor'] ) : '';
|
||||
$allow_author = isset( $_POST['allow_author'] ) ? sanitize_text_field( $_POST['allow_author'] ) : '';
|
||||
$advanced_info_emails = isset( $_POST['advanced_info_emails'] ) ? sanitize_text_field( $_POST['advanced_info_emails'] ) : '';
|
||||
$plugin_links_emails = isset( $_POST['plugin_links_emails'] ) ? sanitize_text_field( $_POST['plugin_links_emails'] ) : '';
|
||||
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'allow_editor'", $allow_editor ) );
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'allow_author'", $allow_author ) );
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'advanced_info_emails'", $advanced_info_emails ) );
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'plugin_links_emails'", $plugin_links_emails ) );
|
||||
|
||||
// Delay
|
||||
$update_delay = isset( $_POST['update_delay'] ) ? sanitize_text_field( $_POST['update_delay'] ) : '';
|
||||
$update_delay_days = isset( $_POST['update_delay_days'] ) ? sanitize_text_field( $_POST['update_delay_days'] ) : '';
|
||||
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'update_delay'", $update_delay ) );
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE $table_name SET onoroff = %s WHERE name = 'update_delay_days'", $update_delay_days ) );
|
||||
|
||||
// Intervals
|
||||
|
||||
// Set variables
|
||||
$plugin_sc = sanitize_text_field( $_POST['plugin_schedule'] );
|
||||
$theme_sc = sanitize_text_field( $_POST['theme_schedule'] );
|
||||
$core_sc = sanitize_text_field( $_POST['core_schedule'] );
|
||||
$schedule_mail = sanitize_text_field( $_POST['update_notifications'] );
|
||||
$outdated_notifier = sanitize_text_field( $_POST['outdated_notifier'] );
|
||||
|
||||
// First clear schedules
|
||||
wp_clear_scheduled_hook( 'wp_update_plugins' );
|
||||
wp_clear_scheduled_hook( 'wp_update_themes' );
|
||||
wp_clear_scheduled_hook( 'wp_version_check' );
|
||||
wp_clear_scheduled_hook( 'cau_set_schedule_mail' );
|
||||
wp_clear_scheduled_hook( 'cau_custom_hooks_plugins' );
|
||||
wp_clear_scheduled_hook( 'cau_custom_hooks_themes' );
|
||||
wp_clear_scheduled_hook( 'cau_log_updater' );
|
||||
wp_clear_scheduled_hook( 'cau_outdated_notifier' );
|
||||
|
||||
// Then set the new times
|
||||
|
||||
// Plugins
|
||||
if( $plugin_sc == 'daily' ) {
|
||||
|
||||
$date = date( 'Y-m-d' );
|
||||
$hours = sanitize_text_field( $_POST['plugin_schedule-sethour'] );
|
||||
$minutes = sanitize_text_field( $_POST['plugin_schedule-setminutes'] );
|
||||
$seconds = date( 's' );
|
||||
$fullDate = $date.' '.$hours.':'.$minutes.':'.$seconds;
|
||||
$pluginSetTime = strtotime( $fullDate );
|
||||
|
||||
wp_schedule_event( $pluginSetTime, $plugin_sc, 'wp_update_plugins' );
|
||||
wp_schedule_event( $pluginSetTime, $plugin_sc, 'cau_custom_hooks_plugins' );
|
||||
wp_schedule_event( ( $pluginSetTime - 1800 ), $plugin_sc, 'cau_log_updater' );
|
||||
|
||||
} else {
|
||||
wp_schedule_event( time(), $plugin_sc, 'wp_update_plugins' );
|
||||
wp_schedule_event( time(), $plugin_sc, 'cau_custom_hooks_plugins' );
|
||||
wp_schedule_event( ( time() - 1800 ), $plugin_sc, 'cau_log_updater' );
|
||||
}
|
||||
|
||||
// Themes
|
||||
if( $theme_sc == 'daily' ) {
|
||||
|
||||
$dateT = date( 'Y-m-d' );
|
||||
$hoursT = sanitize_text_field( $_POST['theme_schedule-sethour'] );
|
||||
$minutesT = sanitize_text_field( $_POST['theme_schedule-setminutes'] );
|
||||
$secondsT = date( 's' );
|
||||
$fullDateT = $dateT.' '.$hoursT.':'.$minutesT.':'.$secondsT;
|
||||
$themeSetTime = strtotime( $fullDateT );
|
||||
|
||||
wp_schedule_event( $themeSetTime, $theme_sc, 'wp_update_themes' );
|
||||
wp_schedule_event( $themeSetTime, $theme_sc, 'cau_custom_hooks_themes' );
|
||||
|
||||
} else {
|
||||
wp_schedule_event( time(), $theme_sc, 'wp_update_themes' );
|
||||
wp_schedule_event( time(), $theme_sc, 'cau_custom_hooks_themes' );
|
||||
}
|
||||
|
||||
// Core
|
||||
if( $core_sc == 'daily' ) {
|
||||
|
||||
$dateC = date( 'Y-m-d' );
|
||||
$hoursC = sanitize_text_field( $_POST['core_schedule-sethour'] );
|
||||
$minutesC = sanitize_text_field( $_POST['core_schedule-setminutes'] );
|
||||
$secondsC = date( 's' );
|
||||
$fullDateC = $dateC.' '.$hoursC.':'.$minutesC.':'.$secondsC;
|
||||
$coreSetTime = strtotime( $fullDateC );
|
||||
|
||||
wp_schedule_event( $coreSetTime, $core_sc, 'wp_version_check' );
|
||||
|
||||
} else {
|
||||
wp_schedule_event( time(), $core_sc, 'wp_version_check' );
|
||||
}
|
||||
|
||||
// Update notifications
|
||||
if( $schedule_mail == 'daily' ) {
|
||||
|
||||
$dateT = date( 'Y-m-d' );
|
||||
$hoursT = sanitize_text_field( $_POST['update_notifications-sethour'] );
|
||||
$minutesT = sanitize_text_field( $_POST['update_notifications-setminutes'] );
|
||||
$secondsT = date( 's' );
|
||||
$fullDateT = $dateT.' '.$hoursT.':'.$minutesT.':'.$secondsT;
|
||||
$emailSetTime = strtotime( $fullDateT );
|
||||
|
||||
wp_schedule_event( $emailSetTime, $schedule_mail, 'cau_set_schedule_mail' );
|
||||
|
||||
} else {
|
||||
wp_schedule_event( time(), $schedule_mail, 'cau_set_schedule_mail' );
|
||||
}
|
||||
|
||||
// Outdated notifications
|
||||
if( $outdated_notifier == 'daily' ) {
|
||||
|
||||
$dateT = date( 'Y-m-d' );
|
||||
$hoursT = sanitize_text_field( $_POST['outdated_notifier-sethour'] );
|
||||
$minutesT = sanitize_text_field( $_POST['outdated_notifier-setminutes'] );
|
||||
$secondsT = date( 's' );
|
||||
$fullDateT = $dateT.' '.$hoursT.':'.$minutesT.':'.$secondsT;
|
||||
$emailSetTime = strtotime( $fullDateT );
|
||||
|
||||
wp_schedule_event( $emailSetTime, $outdated_notifier, 'cau_outdated_notifier' );
|
||||
|
||||
} else {
|
||||
wp_schedule_event( time(), $outdated_notifier, 'cau_outdated_notifier' );
|
||||
}
|
||||
|
||||
|
||||
echo '<div id="message" class="updated"><p><b>'.__( 'Settings saved.' ).'</b></p></div>';
|
||||
|
||||
}
|
||||
|
||||
// Welcome screen for first time viewers
|
||||
if( isset( $_GET['welcome'] ) ) {
|
||||
echo '<div class="welcome-to-cau welcome-bg" style="margin-bottom: 0px;">
|
||||
<div class="welcome-image">
|
||||
</div><div class="welcome-content">
|
||||
|
||||
<h3>'.__( 'Welcome to Companion Auto Update', 'companion-auto-update' ).'</h3>
|
||||
<br />
|
||||
<p><strong>'.__( 'You\'re set and ready to go', 'companion-auto-update' ).'</strong></p>
|
||||
<p>'.__( 'The plugin is all set and ready to go with the recommended settings, but if you\'d like you can change them below.' ).'</p>
|
||||
<br />
|
||||
<p><strong>'.__( 'Get Started' ).': </strong> <a href="'.cau_url( 'pluginlist' ).'">'.__( 'Update filter', 'companion-auto-update' ).'</a> |
|
||||
<strong>'.__( 'More Actions' ).': </strong> <a href="http://codeermeneer.nl/cau_poll/" target="_blank">'.__('Give feedback', 'companion-auto-update').'</a> - <a href="https://translate.wordpress.org/projects/wp-plugins/companion-auto-update/" target="_blank">'.__( 'Help us translate', 'companion-auto-update' ).'</a></p>
|
||||
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
$cs_hooks_p = wp_get_schedule( 'cau_custom_hooks_plugins' );
|
||||
$cs_hooks_t = wp_get_schedule( 'cau_custom_hooks_themes' );
|
||||
|
||||
?>
|
||||
|
||||
<div class="cau-dashboard cau-column-wide">
|
||||
|
||||
<form method="POST">
|
||||
|
||||
<div class="welcome-to-cau update-bg cau-dashboard-box">
|
||||
|
||||
<h2 class="title"><?php _e('Auto Updater', 'companion-auto-update');?></h2>
|
||||
|
||||
<table class="form-table">
|
||||
<tr>
|
||||
<td>
|
||||
<fieldset>
|
||||
|
||||
<?php
|
||||
|
||||
$plugins_on = ( cau_get_db_value( 'plugins' ) == 'on' ) ? "CHECKED" : "";
|
||||
$themes_on = ( cau_get_db_value( 'themes' ) == 'on' ) ? "CHECKED" : "";
|
||||
$minor_on = ( cau_get_db_value( 'minor' ) == 'on' ) ? "CHECKED" : "";
|
||||
$major_on = ( cau_get_db_value( 'major' ) == 'on' ) ? "CHECKED" : "";
|
||||
$translations_on = ( cau_get_db_value( 'translations' ) == 'on' ) ? "CHECKED" : "";
|
||||
|
||||
echo "<p><input id='plugins' name='plugins' type='checkbox' {$plugins_on}/><label for='plugins'>".__( 'Auto update plugins?', 'companion-auto-update' )."</label></p>";
|
||||
echo "<p><input id='themes' name='themes' type='checkbox' {$themes_on}/><label for='themes'>".__( 'Auto update themes?', 'companion-auto-update' )."</label></p>";
|
||||
echo "<p><input id='minor' name='minor' type='checkbox' {$minor_on}/><label for='minor'>".__( 'Auto update minor core updates?', 'companion-auto-update' )." <code class='majorMinorExplain'>6.0.0 > 6.0.1</code></label></p>";
|
||||
echo "<p><input id='major' name='major' type='checkbox' {$major_on}/><label for='major'>".__( 'Auto update major core updates?', 'companion-auto-update' )." <code class='majorMinorExplain'>6.0.0 > 6.1.0</code></label></p>";
|
||||
echo "<p><input id='translations' name='translations' type='checkbox' {$translations_on}/><label for='translations'>".__( 'Auto update translation files?', 'companion-auto-update' )."</label></p>";
|
||||
|
||||
?>
|
||||
|
||||
</fieldset>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="welcome-to-cau email-bg cau-dashboard-box">
|
||||
|
||||
<h2 class="title"><?php _e( 'Email Notifications', 'companion-auto-update' );?></h2>
|
||||
|
||||
<?php
|
||||
|
||||
$db_email = cau_get_db_value( 'email' );
|
||||
$toemail = ( $db_email == '' ) ? get_option( 'admin_email' ) : $db_email;
|
||||
|
||||
$hot = cau_get_db_value( 'html_or_text' );
|
||||
|
||||
?>
|
||||
|
||||
<table class="form-table">
|
||||
<tr>
|
||||
<th scope="row"><?php _e( 'Update notifications', 'companion-auto-update' );?></th>
|
||||
<td>
|
||||
<p>
|
||||
<input id="cau_send_update" name="cau_send_update" type="checkbox" <?php if( cau_get_db_value( 'sendupdate' ) == 'on' ) { echo 'checked'; } ?> />
|
||||
<label for="cau_send_update"><?php _e( 'Send me emails when something has been updated.', 'companion-auto-update' );?></label>
|
||||
</p>
|
||||
<p>
|
||||
<input id="cau_send" name="cau_send" type="checkbox" <?php if( cau_get_db_value( 'send' ) == 'on' ) { echo 'checked'; } ?> />
|
||||
<label for="cau_send"><?php _e( 'Send me emails when an update is available.', 'companion-auto-update' );?></label>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php _e( 'Check for outdated software', 'companion-auto-update' );?></th>
|
||||
<td>
|
||||
<p>
|
||||
<input id="cau_send_outdated" name="cau_send_outdated" type="checkbox" <?php if( cau_get_db_value( 'sendoutdated' ) == 'on' ) { echo 'checked'; } ?> />
|
||||
<label for="cau_send_outdated"><?php _e( 'Be notified of plugins that have not been tested with the 3 latest major versions of WordPress.', 'companion-auto-update' );?></label>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php _e( 'Email Address', 'companion-auto-update' );?></th>
|
||||
<td>
|
||||
<p>
|
||||
<label for="cau_email"><?php _e( 'To', 'companion-auto-update' ); ?>:</label>
|
||||
<input type="text" name="cau_email" id="cau_email" class="regular-text" placeholder="<?php echo get_option( 'admin_email' ); ?>" value="<?php echo esc_html( $toemail ); ?>" />
|
||||
</p>
|
||||
|
||||
<p class="description"><?php _e('Seperate email addresses using commas.', 'companion-auto-update');?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php _e( 'Use HTML in emails?', 'companion-auto-update' );?></th>
|
||||
<td>
|
||||
<p>
|
||||
<select id='html_or_text' name='html_or_text'>
|
||||
<option value='html' <?php if( $hot == 'html' ) { echo "SELECTED"; } ?>><?php _e( 'Use HTML', 'companion-auto-update' ); ?></option>
|
||||
<option value='text' <?php if( $hot == 'text' ) { echo "SELECTED"; } ?>><?php _e( 'Use plain text', 'companion-auto-update' ); ?></option>
|
||||
</select>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php _e( 'Show more info in emails', 'companion-auto-update' );?></th>
|
||||
<td>
|
||||
<p>
|
||||
<label for="advanced_info_emails"><input name="advanced_info_emails" type="checkbox" id="advanced_info_emails" <?php if( cau_get_db_value( 'advanced_info_emails' ) == 'on' ) { echo "CHECKED"; } ?>> <?php _e( 'Show the time of the update', 'companion-auto-update' ); ?></label>
|
||||
</p>
|
||||
<p>
|
||||
<label for="plugin_links_emails"><input name="plugin_links_emails" type="checkbox" id="plugin_links_emails" <?php if( cau_get_db_value( 'plugin_links_emails' ) == 'on' ) { echo "CHECKED"; } ?>> <?php _e( 'Show links to WordPress.org pages', 'companion-auto-update' ); ?></label>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<?php _e( 'WordPress notifications', 'companion-auto-update' );?>
|
||||
<span class='cau_tooltip'><span class="dashicons dashicons-editor-help"></span>
|
||||
<span class='cau_tooltip_text'>
|
||||
<?php _e( 'Core notifications are handled by WordPress and not by this plugin. You can only disable them, changing your email address in the settings above will not affect these notifications.', 'companion-auto-update' );?>
|
||||
</span>
|
||||
</span>
|
||||
</th>
|
||||
<td>
|
||||
<p>
|
||||
<input id="wpemails" name="wpemails" type="checkbox" <?php if( cau_get_db_value( 'wpemails' ) == 'on' ) { echo 'checked'; } ?> />
|
||||
<label for="wpemails"><?php _e( 'By default WordPress sends an email when a core update has occurred. Uncheck this box to disable these emails.', 'companion-auto-update' ); ?></label>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php _e( 'Database update required', 'companion-auto-update' );?></th>
|
||||
<td>
|
||||
<p>
|
||||
<input id="dbupdateemails" name="dbupdateemails" type="checkbox" <?php if( cau_get_db_value( 'dbupdateemails' ) == 'on' ) { echo 'checked'; } ?> />
|
||||
<label for="dbupdateemails"><?php _e( 'Sometimes we\'ll need your help updating our database version to the latest version, check this box to allow us to send you an email about this.', 'companion-auto-update' ); ?></label>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="welcome-to-cau interval-bg cau-dashboard-box" style="overflow: hidden;">
|
||||
|
||||
<h2 class="title"><?php _e( 'Intervals', 'companion-auto-update' );?></h2>
|
||||
|
||||
<?php
|
||||
|
||||
function cau_show_interval_selection( $identiefier, $schedule ) {
|
||||
|
||||
// Get the info
|
||||
$setValue = wp_get_schedule( $schedule );
|
||||
$setTime = wp_next_scheduled( $schedule );
|
||||
$setHour = date( 'H' , $setTime );
|
||||
$setMinutes = date( 'i' , $setTime );
|
||||
|
||||
// Show interval selection
|
||||
echo "<p>";
|
||||
echo "<select name='$identiefier' id='$identiefier' class='schedule_interval wide interval_scheduler' data-timeblock='$identiefier'>";
|
||||
foreach ( cau_wp_get_schedules() as $key => $value ) {
|
||||
echo "<option "; if( $setValue == $key ) { echo "selected "; } echo "value='".$key."'>".$value."</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "</p>";
|
||||
|
||||
// Set the time when daily is selected
|
||||
echo "<div class='timeblock-$identiefier' style='display: none;'>";
|
||||
|
||||
echo "<div class='cau_schedule_input'>
|
||||
<input type='number' min='0' max='23' name='".$identiefier."-sethour' value='$setHour' maxlength='2' >
|
||||
</div><div class='cau_schedule_input_div'>
|
||||
:
|
||||
</div><div class='cau_schedule_input'>
|
||||
<input type='number' min='0' max='59' name='".$identiefier."-setminutes' value='$setMinutes' maxlength='2' >
|
||||
</div><div class='cau_shedule_notation'>
|
||||
<span class='cau_tooltip'><span class='dashicons dashicons-editor-help'></span>
|
||||
<span class='cau_tooltip_text'>".__( 'At what time should the updater run? Only works when set to <u>daily</u>.', 'companion-auto-update' )." - ".__( 'Time notation: 24H', 'companion-auto-update' )."</span>
|
||||
</span>
|
||||
</div>";
|
||||
|
||||
echo "</div>";
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="welcome-column">
|
||||
|
||||
<h4><?php _e( 'Plugin update interval', 'companion-auto-update' );?></h4>
|
||||
<?php cau_show_interval_selection( 'plugin_schedule', 'wp_update_plugins' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="welcome-column">
|
||||
|
||||
<h4><?php _e( 'Theme update interval', 'companion-auto-update' );?></h4>
|
||||
<?php cau_show_interval_selection( 'theme_schedule', 'wp_update_themes' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="welcome-column">
|
||||
|
||||
<h4><?php _e( 'Core update interval', 'companion-auto-update' );?></h4>
|
||||
<?php cau_show_interval_selection( 'core_schedule', 'wp_version_check' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<p></p>
|
||||
|
||||
<div class="welcome-column">
|
||||
|
||||
<h4><?php _e( 'Update notifications', 'companion-auto-update' );?></h4>
|
||||
<?php cau_show_interval_selection( 'update_notifications', 'cau_set_schedule_mail' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="welcome-column">
|
||||
|
||||
<h4><?php _e( 'Outdated software', 'companion-auto-update' );?></h4>
|
||||
<?php cau_show_interval_selection( 'outdated_notifier', 'cau_outdated_notifier' ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="welcome-to-cau advanced-bg cau-dashboard-box">
|
||||
|
||||
<h2 class="title"><?php _e( 'Advanced settings', 'companion-auto-update' ); ?></h2>
|
||||
|
||||
<?php
|
||||
|
||||
// Access
|
||||
$accessallowed = cau_allowed_user_rights_array();
|
||||
$has_editor = in_array( 'editor', $accessallowed ) ? true : false;
|
||||
$has_author = in_array( 'author', $accessallowed ) ? true : false;
|
||||
|
||||
// Update delays
|
||||
$has_updatedelay = ( cau_get_db_value( 'update_delay' ) == 'on' ) ? true : false;
|
||||
|
||||
?>
|
||||
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"><label><?php _e( 'Allow access to:', 'companion-auto-update' ); ?></label></th>
|
||||
<td>
|
||||
<p><label for="allow_administrator"><input name="allow_administrator" type="checkbox" id="allow_administrator" disabled="" checked=""><?php _e( 'Administrator', 'companion-auto-update' ); ?></label></p>
|
||||
<p><label for="allow_editor"><input name="allow_editor" type="checkbox" id="allow_editor" <?php if( $has_editor ) { echo "CHECKED"; } ?>><?php _e( 'Editor', 'companion-auto-update' ); ?></label></p>
|
||||
<p><label for="allow_author"><input name="allow_author" type="checkbox" id="allow_author" <?php if( $has_author ) { echo "CHECKED"; } ?>><?php _e( 'Author', 'companion-auto-update' ); ?></label></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label><?php _e( 'Delay updates', 'companion-auto-update' ); ?></label></th>
|
||||
<td>
|
||||
<p><label for="update_delay"><input name="update_delay" type="checkbox" id="update_delay" <?php echo $has_updatedelay ? "CHECKED" : ""; ?> ><?php _e( 'Delay updates', 'companion-auto-update' ); ?></label></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id='update_delay_days_block' <?php echo !$has_updatedelay ? "class='disabled_option'" : ""; ?>>
|
||||
<th scope="row"><label><?php _e( 'Number of days', 'companion-auto-update' ); ?></label></th>
|
||||
<td>
|
||||
<input type="number" min="0" max="31" name="update_delay_days" id="update_delay_days" class="regular-text" value="<?php echo cau_get_db_value( 'update_delay_days' ); ?>" />
|
||||
<p><?php _e( 'For how many days should updates be put on hold?', 'companion-auto-update' ); ?></p>
|
||||
<p><small><strong>Please note:</strong> Delaying updates does not work with WordPress updates yet.</small></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<?php wp_nonce_field( 'cau_save_settings' ); ?>
|
||||
|
||||
<div class="cau_save_button">
|
||||
<?php submit_button(); ?>
|
||||
</div>
|
||||
<div class="cau_save_button__space"></div>
|
||||
|
||||
<script>jQuery( '.cau-dashboard input, .cau-dashboard select, .cau-dashboard textarea' ).on( 'change', function() { jQuery('.cau_save_button').addClass( 'fixed_button' ); } );</script>
|
||||
|
||||
</form>
|
||||
|
||||
</div><div class="cau-column-small">
|
||||
|
||||
<div class="welcome-to-cau help-bg cau-dashboard-box">
|
||||
<div class="welcome-column welcome-column.welcome-column-half">
|
||||
<h3 class="support-sidebar-title"><?php _e( 'Help' ); ?></h3>
|
||||
<ul class="support-sidebar-list">
|
||||
<li><a href="https://codeermeneer.nl/stuffs/faq-auto-updater/" target="_blank"><?php _e( 'Frequently Asked Questions', 'companion-auto-update' ); ?></a></li>
|
||||
<li><a href="https://wordpress.org/support/plugin/companion-auto-update" target="_blank"><?php _e( 'Support Forums' ); ?></a></li>
|
||||
</ul>
|
||||
|
||||
<h3 class="support-sidebar-title"><?php _e( 'Want to contribute?', 'companion-auto-update' ); ?></h3>
|
||||
<ul class="support-sidebar-list">
|
||||
<li><a href="http://codeermeneer.nl/cau_poll/" target="_blank"><?php _e( 'Give feedback', 'companion-auto-update' ); ?></a></li>
|
||||
<li><a href="https://codeermeneer.nl/blog/companion-auto-update-and-its-future/" target="_blank"><?php _e( 'Feature To-Do List', 'companion-auto-update' ); ?></a></li>
|
||||
<li><a href="https://translate.wordpress.org/projects/wp-plugins/companion-auto-update/" target="_blank"><?php _e( 'Help us translate', 'companion-auto-update' ); ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="welcome-column welcome-column.welcome-column-half">
|
||||
<h3 class="support-sidebar-title"><?php _e( 'Developer?', 'companion-auto-update' ); ?></h3>
|
||||
<ul class="support-sidebar-list">
|
||||
<li><a href="https://codeermeneer.nl/documentation/auto-update/" target="_blank"><?php _e( 'Documentation' ); ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="welcome-to-cau support-bg cau-dashboard-box">
|
||||
<div class="welcome-column welcome-column">
|
||||
<h3><?php _e('Support', 'companion-auto-update');?></h3>
|
||||
<p><?php _e('Feel free to reach out to us if you have any questions or feedback.', 'companion-auto-update'); ?></p>
|
||||
<p><a href="https://codeermeneer.nl/contact/" target="_blank" class="button button-primary"><?php _e( 'Contact us', 'companion-auto-update' ); ?></a></p>
|
||||
<p><a href="https://codeermeneer.nl/plugins/" target="_blank" class="button button-alt"><?php _e('Check out our other plugins', 'companion-auto-update');?></a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="welcome-to-cau love-bg cau-show-love cau-dashboard-box">
|
||||
<h3><?php _e( 'Like our plugin?', 'companion-auto-update' ); ?></h3>
|
||||
<p><?php _e('Companion Auto Update is free to use. It has required a great deal of time and effort to develop and you can help support this development by making a small donation.<br />You get useful software and we get to carry on making it better.', 'companion-auto-update'); ?></p>
|
||||
<a href="https://wordpress.org/support/plugin/companion-auto-update/reviews/#new-post" target="_blank" class="button button-alt button-hero">
|
||||
<?php _e('Rate us (5 stars?)', 'companion-auto-update'); ?>
|
||||
</a>
|
||||
<a href="<?php echo cau_donateUrl(); ?>" target="_blank" class="button button-primary button-hero">
|
||||
<?php _e('Donate to help development', 'companion-auto-update'); ?>
|
||||
</a>
|
||||
<p style="font-size: 12px; color: #BDBDBD;"><?php _e( 'Donations via PayPal. Amount can be changed.', 'companion-auto-update'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="welcome-to-cau cau-dashboard-box">
|
||||
<h3><span style='background: #EBE3F7; color: #BCADD3; padding: 1px 5px; border-radius: 3px; font-size: .8em'>Plugin Promotion</span></h3>
|
||||
<h3>Keep your site fast with our Revision Manager</h3>
|
||||
<p>Post Revisions are great, but will also slow down your site. Take back control over revisions with Companion Revision Manager!</p>
|
||||
<a href="https://codeermeneer.nl/portfolio/plugin/companion-revision-manager/" target="_blank" class="button button-alt">Read more</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.disabled_option {
|
||||
opacity: .5;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
jQuery( '#update_delay' ).change( function() {
|
||||
jQuery( '#update_delay_days_block' ).toggleClass( 'disabled_option' );
|
||||
});
|
||||
|
||||
jQuery( '.interval_scheduler' ).change( function() {
|
||||
|
||||
var selected = jQuery(this).val(); // Selected value
|
||||
var timeblock = jQuery(this).data( 'timeblock' ); // Corresponding time block
|
||||
|
||||
if( selected == 'daily' ) {
|
||||
jQuery( '.timeblock-'+timeblock ).show();
|
||||
} else {
|
||||
jQuery( '.timeblock-'+timeblock ).hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
jQuery( '.interval_scheduler' ).each( function() {
|
||||
|
||||
var selected = jQuery(this).val(); // Selected value
|
||||
var timeblock = jQuery(this).data( 'timeblock' ); // Corresponding time block
|
||||
|
||||
if( selected == 'daily' ) {
|
||||
jQuery( '.timeblock-'+timeblock ).show();
|
||||
} else {
|
||||
jQuery( '.timeblock-'+timeblock ).hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
if( isset( $_GET['filter'] ) ) {
|
||||
|
||||
|
||||
$filter = $_GET['filter'];
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
$filter = 'all';
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
@ -1,185 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Get selected filter type
|
||||
|
||||
|
||||
if( isset( $_GET['filter'] ) ) {
|
||||
|
||||
|
||||
$filter = sanitize_key( $_GET['filter'] );
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
$filter = 'plugins';
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Select correct database row
|
||||
|
||||
|
||||
switch ( $filter ) {
|
||||
|
||||
|
||||
case 'themes':
|
||||
|
||||
|
||||
$db_table = 'notUpdateListTh';
|
||||
|
||||
|
||||
$filter_name = __( 'Themes', 'companion-auto-update' );
|
||||
|
||||
|
||||
$filterFunction = wp_get_themes();
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 'plugins':
|
||||
|
||||
|
||||
$db_table = 'notUpdateList';
|
||||
|
||||
|
||||
$filter_name = __( 'Plugins', 'companion-auto-update' );
|
||||
|
||||
|
||||
$filterFunction = get_plugins();
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
|
||||
$db_table = 'notUpdateList';
|
||||
|
||||
|
||||
$filter_name = __( 'Plugins', 'companion-auto-update' );
|
||||
|
||||
|
||||
$filterFunction = get_plugins();
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul class="subsubsub">
|
||||
|
||||
|
||||
<li><a <?php if( $filter == 'plugins' ) { echo "class='current'"; } ?> href='<?php echo cau_url( 'pluginlist&filter=plugins' ); ?>'><?php _e( 'Plugins', 'companion-auto-update' ); ?></a></li> |
|
||||
|
||||
|
||||
<li><a <?php if( $filter == 'themes' ) { echo "class='current'"; } ?> href='<?php echo cau_url( 'pluginlist&filter=themes' ); ?>'><?php _e( 'Themes', 'companion-auto-update' ); ?></a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div style='clear: both;'></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php if( $filter == 'themes' ) { ?>
|
||||
|
||||
|
||||
<div id="message" class="cau">
|
||||
|
||||
|
||||
We've had to (temporarily) disable the theme filter because it was causing issues on some installations. We'll try to get it working again in a future update.
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p><?php echo sprintf( esc_html__( 'Prevent certain %s from updating automatically. %s that you select here will be skipped by Companion Auto Update and will require manual updating.', 'companion-auto-update' ), strtolower( $filter_name ), $filter_name ); ?></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
global $wpdb;
|
||||
|
||||
|
||||
$table_name = $wpdb->prefix."auto_updates";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Save list
|
||||
|
||||
|
||||
if( isset( $_POST['submit'] ) ) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
check_admin_referer( 'cau_save_pluginlist' );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$noUpdateList = '';
|
||||
|
||||
|
||||
$i = 0;
|
||||
|
||||
|
||||
$noUpdateCount = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if( isset( $_POST['post'] ) ) {
|
||||
|
||||
|
||||
$noUpdateCount = count( $_POST['post'] );
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,2 +0,0 @@
|
||||
<?php
|
||||
|
@ -1,435 +0,0 @@
|
||||
<?php
|
||||
|
||||
// Define globals
|
||||
global $wpdb;
|
||||
|
||||
// Define variables
|
||||
$dateFormat = get_option( 'date_format' );
|
||||
$dateFormat .= ' '.get_option( 'time_format' );
|
||||
$table_name = $wpdb->prefix . "auto_updates";
|
||||
$schedules = wp_get_schedules();
|
||||
$interval_names = cau_wp_get_schedules();
|
||||
|
||||
// Update the database
|
||||
if( isset( $_GET['run'] ) && $_GET['run'] == 'db_update' ) {
|
||||
cau_manual_update();
|
||||
echo '<div id="message" class="updated"><p><b>'.__( 'Database update completed' ).'</b></p></div>';
|
||||
}
|
||||
|
||||
if( isset( $_GET['run'] ) && $_GET['run'] == 'db_info_update' ) {
|
||||
cau_savePluginInformation();
|
||||
echo '<div id="message" class="updated"><p><b>'.__( 'Database information update completed' ).'</b></p></div>';
|
||||
}
|
||||
|
||||
if( isset( $_GET['ignore_report'] ) ) {
|
||||
|
||||
$report_to_ignore = sanitize_text_field( $_GET['ignore_report'] );
|
||||
$allowedValues = array( 'seo', 'cron' );
|
||||
|
||||
if( !in_array( $report_to_ignore, $allowedValues ) ) {
|
||||
|
||||
wp_die( 'Trying to cheat eh?' );
|
||||
|
||||
} else {
|
||||
|
||||
$table_name = $wpdb->prefix . "auto_updates";
|
||||
$wpdb->query( $wpdb->prepare( "UPDATE {$table_name} SET onoroff = %s WHERE name = 'ignore_$report_to_ignore'", 'yes' ) );
|
||||
$__ignored = __( 'This report will now be ignored', 'companion-auto-update' );
|
||||
echo "<div id='message' class='updated'><p><b>$__ignored</b></p></div>";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<div class="cau_status_page">
|
||||
|
||||
<?php
|
||||
|
||||
$events = array(
|
||||
0 => array(
|
||||
'name' => __( 'Events', 'companion-auto-update' ),
|
||||
'fields' => array(
|
||||
'plugins' => __( 'Plugins', 'companion-auto-update' ),
|
||||
'themes' => __( 'Themes', 'companion-auto-update' ),
|
||||
'minor' => __( 'Core (Minor)', 'companion-auto-update' ),
|
||||
'major' => __( 'Core (Major)', 'companion-auto-update' ),
|
||||
'send' => __( 'Update available', 'companion-auto-update' ),
|
||||
'sendupdate' => __( 'Successful update', 'companion-auto-update' ),
|
||||
'wpemails' => __( 'Core notifications', 'companion-auto-update' ),
|
||||
'update_delay' => __( 'Log updater', 'companion-auto-update' ),
|
||||
),
|
||||
'values' => array(
|
||||
'plugins' => 'wp_update_plugins',
|
||||
'themes' => 'wp_update_themes',
|
||||
'minor' => 'wp_version_check',
|
||||
'major' => 'wp_version_check',
|
||||
'send' => 'cau_set_schedule_mail',
|
||||
'sendupdate' => 'cau_set_schedule_mail',
|
||||
'wpemails' => 'cau_set_schedule_mail',
|
||||
'update_delay' => 'cau_log_updater',
|
||||
),
|
||||
'explain' => array(
|
||||
'plugins' => __('Auto update plugins?', 'companion-auto-update'),
|
||||
'themes' => __('Auto update themes?', 'companion-auto-update'),
|
||||
'minor' => __('Auto update minor core updates?', 'companion-auto-update'),
|
||||
'major' => __('Auto update major core updates?', 'companion-auto-update'),
|
||||
'send' => __( 'Will notify you of available updates.', 'companion-auto-update' ),
|
||||
'sendupdate' => __( 'Will notify you after successful updates.', 'companion-auto-update' ),
|
||||
'wpemails' => __( 'The default WordPress notifications.', 'companion-auto-update' ),
|
||||
'update_delay' => __( 'Will keep track of the update log and make sure updates are delayed when needed.', 'companion-auto-update' ),
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
$__sta = __( 'Status', 'companion-auto-update' );
|
||||
$__int = __( 'Interval', 'companion-auto-update' );
|
||||
$__nxt = __( 'Next', 'companion-auto-update' );
|
||||
|
||||
foreach( $events as $event => $info ) {
|
||||
|
||||
echo "<table class='cau_status_list widefat striped'>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='cau_status_name' colspan='2'><strong>{$info['name']}</strong></th>
|
||||
<th class='cau_status_active_state'><strong>{$__sta}</strong></th>
|
||||
<th class='cau_status_interval'><strong>{$__int}</strong></th>
|
||||
<th class='cau_status_next'><strong>{$__nxt}</strong></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody id='the-list'>";
|
||||
|
||||
foreach ( $info['fields'] as $key => $value ) {
|
||||
|
||||
$is_on = ( cau_get_db_value( $key ) == 'on' && wp_get_schedule( $info['values'][$key] ) ) ? true : false;
|
||||
$__status = $is_on ? 'enabled' : 'warning';
|
||||
$__icon = $is_on ? 'yes-alt' : 'marker';
|
||||
$__text = $is_on ? __( 'Enabled', 'companion-auto-update' ) : __( 'Disabled', 'companion-auto-update' );
|
||||
$__interval = $is_on ? $interval_names[wp_get_schedule( $info['values'][$key] )] : '‐';
|
||||
$__next = $is_on ? date_i18n( $dateFormat, wp_next_scheduled( $info['values'][$key] ) ) : '‐';
|
||||
$__exp = !empty( $info['explain'][$key] ) ? '<br /><small>'.$info['explain'][$key].'</small>' : '';
|
||||
$__nxt = __( 'Next', 'companion-auto-update' );
|
||||
|
||||
echo "<tr>
|
||||
<td class='cau_status_icon'><span class='dashicons dashicons-$__icon cau_$__status'></span></td>
|
||||
<td class='cau_status_name'><strong>$value</strong>$__exp</td>
|
||||
<td class='cau_status_active_state'><span class='cau_$__status'>$__text</span></td>
|
||||
<td class='cau_status_interval'>$__interval</td>
|
||||
<td class='cau_status_next'><span class='cau_mobile_prefix'>$__nxt: </span>$__next</td>
|
||||
</tr>";
|
||||
|
||||
}
|
||||
|
||||
echo "</tbody>
|
||||
|
||||
</table>";
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<table class="cau_status_list widefat striped cau_status_warnings">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="cau_plugin_issue_name" colspan="5"><strong><?php _e( 'Status' ); ?></strong></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody id="the-list">
|
||||
|
||||
<!-- checkAutomaticUpdaterDisabled -->
|
||||
<tr>
|
||||
<td class='cau_status_icon'><span class="dashicons dashicons-update"></span></td>
|
||||
<td><?php _e( 'Auto updates', 'companion-auto-update' ); ?></td>
|
||||
<?php if ( checkAutomaticUpdaterDisabled() ) { ?>
|
||||
<td class="cau_status_active_state"><span class='cau_disabled'><span class="dashicons dashicons-no"></span> <?php _e( 'All automatic updates are disabled', 'companion-auto-update' ); ?></span></td>
|
||||
<td>
|
||||
<form method="POST">
|
||||
<?php wp_nonce_field( 'cau_fixit' ); ?>
|
||||
<button type="submit" name="fixit" class="button button-primary"><?php _e( 'Fix it', 'companion-auto-update' ); ?></button>
|
||||
<a href="https://codeermeneer.nl/documentation/known-issues-fixes/#updates_disabled" target="_blank" class="button"><?php _e( 'How to fix this', 'companion-auto-update' ); ?></a>
|
||||
</form>
|
||||
</td>
|
||||
<?php } else { ?>
|
||||
<td class="cau_status_active_state"><span class='cau_enabled'><span class="dashicons dashicons-yes-alt"></span> <?php _e( 'No issues detected', 'companion-auto-update' ); ?></span></td>
|
||||
<td></td>
|
||||
<?php } ?>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<!-- Connection with WP.org -->
|
||||
<tr>
|
||||
<td class='cau_status_icon'><span class="dashicons dashicons-wordpress"></span></td>
|
||||
<td><?php _e( 'Connection with WordPress.org', 'companion-auto-update' ); ?></td>
|
||||
<?php if( wp_http_supports( array( 'ssl' ) ) == '1' ) {
|
||||
$__text = __( 'No issues detected', 'companion-auto-update' );
|
||||
echo "<td colspan='3' class='cau_status_active_state'><span class='cau_enabled'><span class='dashicons dashicons-yes-alt'></span> $__text</span></td>";
|
||||
} else {
|
||||
$__text = __( 'Disabled', 'companion-auto-update' );
|
||||
echo "<td colspan='3' class='cau_status_active_state'><span class='cau_disabled'><span class='dashicons dashicons-no'></span> $__text</span></td>";
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
|
||||
<!-- ignore_seo check -->
|
||||
<tr <?php if( cau_get_db_value( 'ignore_seo' ) == 'yes' ) { echo "class='report_hidden'"; } ?> >
|
||||
<td class='cau_status_icon'><span class="dashicons dashicons-search"></span></td>
|
||||
<td><?php _e( 'Search Engine Visibility', 'companion-auto-update' ); ?></td>
|
||||
<?php if( get_option( 'blog_public' ) == 0 ) { ?>
|
||||
<td colspan="2" class="cau_status_active_state">
|
||||
<span class='cau_warning'><span class="dashicons dashicons-warning"></span></span>
|
||||
<?php _e( 'You’ve chosen to discourage Search Engines from indexing your site. Auto-updating works best on sites with more traffic, consider enabling indexing for your site.', 'companion-auto-update' ); ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?php echo admin_url( 'options-reading.php' ); ?>" class="button"><?php _e( 'Fix it', 'companion-auto-update' ); ?></a>
|
||||
<a href="<?php echo cau_url( 'status' ); ?>&ignore_report=seo" class="button button-alt"><?php _e( 'Ignore this report', 'companion-auto-update' ); ?></a>
|
||||
</td>
|
||||
<?php } else { ?>
|
||||
<td colspan="3" class="cau_status_active_state"><span class='cau_enabled'><span class="dashicons dashicons-yes-alt"></span> <?php _e( 'No issues detected', 'companion-auto-update' ); ?></span></td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
|
||||
<!-- ignore_cron check -->
|
||||
<tr <?php if( cau_get_db_value( 'ignore_cron' ) == 'yes' ) { echo "class='report_hidden'"; } ?> >
|
||||
<td class='cau_status_icon'><span class="dashicons dashicons-admin-generic"></span></td>
|
||||
<td><?php _e( 'Cronjobs', 'companion-auto-update' ); ?></td>
|
||||
<?php if( checkCronjobsDisabled() ) { ?>
|
||||
<td class="cau_status_active_state"><span class='cau_warning'><span class="dashicons dashicons-warning"></span> <?php _e( 'Disabled', 'companion-auto-update' ); ?></span></td>
|
||||
<td><code>DISABLE_WP_CRON true</code></td>
|
||||
<td>
|
||||
<a href="https://codeermeneer.nl/contact/" class="button"><?php _e( 'Contact for support', 'companion-auto-update' ); ?></a>
|
||||
<a href="<?php echo cau_url( 'status' ); ?>&ignore_report=cron" class="button button-alt"><?php _e( 'Ignore this report', 'companion-auto-update' ); ?></a>
|
||||
</td>
|
||||
<?php } else { ?>
|
||||
<td colspan="3" class="cau_status_active_state"><span class='cau_enabled'><span class="dashicons dashicons-yes-alt"></span> <?php _e( 'No issues detected', 'companion-auto-update' ); ?></span></td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
|
||||
<!-- wp_version_check -->
|
||||
<tr>
|
||||
<td class='cau_status_icon'><span class="dashicons dashicons-wordpress-alt"></span></td>
|
||||
<td>wp_version_check</td>
|
||||
<?php if ( !has_filter( 'wp_version_check', 'wp_version_check' ) ) { ?>
|
||||
<td colspan="2" class="cau_status_active_state"><span class='cau_disabled'><span class="dashicons dashicons-no"></span> <?php _e( 'A plugin has prevented updates by disabling wp_version_check', 'companion-auto-update' ); ?></span></td>
|
||||
<td><a href="https://codeermeneer.nl/contact/" class="button"><?php _e( 'Contact for support', 'companion-auto-update' ); ?></a></td>
|
||||
<?php } else { ?>
|
||||
<td colspan="3" class="cau_status_active_state"><span class='cau_enabled'><span class="dashicons dashicons-yes-alt"></span> <?php _e( 'No issues detected' , 'companion-auto-update' ); ?></span></td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
|
||||
<!-- VCD -->
|
||||
<tr>
|
||||
<td class='cau_status_icon'><span class="dashicons dashicons-open-folder"></span></td>
|
||||
<td>VCS</td>
|
||||
<td colspan="3" class="cau_status_active_state"><span class='cau_<?php echo cau_test_is_vcs_checkout( ABSPATH )['status']; ?>'><span class="dashicons dashicons-<?php echo cau_test_is_vcs_checkout( ABSPATH )['icon']; ?>"></span> <?php echo cau_test_is_vcs_checkout( ABSPATH )['description']; ?></span></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
<table class="autoupdate cau_status_list widefat striped cau_status_warnings">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="5"><strong><?php _e( 'Systeminfo', 'companion-auto-update' ); ?></strong></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody id="the-list">
|
||||
|
||||
<tr>
|
||||
<td class='cau_status_icon'><span class="dashicons dashicons-wordpress"></span></td>
|
||||
<td>WordPress</td>
|
||||
<td><?php echo get_bloginfo( 'version' ); ?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr <?php if( version_compare( PHP_VERSION, '5.1.0', '<' ) ) { echo "class='inactive'"; } ?>>
|
||||
<td class='cau_status_icon'><span class="dashicons dashicons-media-code"></span></td>
|
||||
<td>PHP</td>
|
||||
<td><?php echo phpversion(); ?> <code>(Required: 5.1.0 or up)</code></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr <?php if( cau_incorrectDatabaseVersion() ) { echo "class='inactive'"; } ?>>
|
||||
<td class='cau_status_icon'><span class="dashicons dashicons-database"></span></td>
|
||||
<td>Database</td>
|
||||
<td><?php echo get_option( "cau_db_version" ); ?> <code>(Latest: <?php echo cau_db_version(); ?>)</code></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class='cau_status_icon'><span class="dashicons dashicons-calendar"></span></td>
|
||||
<td class="cau_status_name"><?php _e( 'Timezone' ); ?></td>
|
||||
<td class="cau_status_active_state"><?php echo cau_get_proper_timezone(); ?> (GMT <?php echo get_option('gmt_offset'); ?>) - <?php echo date_default_timezone_get(); ?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
// If has incomptable plugins
|
||||
if( cau_incompatiblePlugins() ) { ?>
|
||||
|
||||
<table class="cau_status_list no_column_width widefat striped cau_status_warnings">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="cau_plugin_issue_name" colspan="4"><strong><?php _e( 'Possible plugin issues', 'companion-auto-update' ); ?></strong></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody id="the-list">
|
||||
<?php
|
||||
|
||||
foreach ( cau_incompatiblePluginlist() as $key => $value ) {
|
||||
if( is_plugin_active( $key ) ) {
|
||||
echo '<tr>
|
||||
<td class="cau_plugin_issue_name"><strong>'.$key.'</strong></td>
|
||||
<td colspan="2" class="cau_plugin_issue_explain">'.$value.'</td>
|
||||
<td class="cau_plugin_issue_fixit"><a href="https://codeermeneer.nl/documentation/known-issues-fixes/#plugins" target="_blank" class="button">'.__( 'How to fix this', 'companion-auto-update' ).'</a></td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<!-- Advanced info -->
|
||||
<table class="autoupdate cau_status_list widefat striped cau_status_warnings">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th><strong><?php _e( 'Advanced info', 'companion-auto-update' ); ?></strong> ‐ <?php _e( 'For when you need our help fixing an issue.', 'companion-auto-update' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody id="the-list">
|
||||
<tr>
|
||||
<td>
|
||||
<div class='button button-primary toggle_advanced_button'><?php _e( 'Toggle', 'companion-auto-update' ); ?></div>
|
||||
<div class='toggle_advanced_content' style='display: none;'>
|
||||
<?php
|
||||
$cau_configs = $wpdb->get_results( "SELECT * FROM $table_name" );
|
||||
array_push( $cau_configs, "WordPress: ".get_bloginfo( 'version' ) );
|
||||
array_push( $cau_configs, "PHP: ".phpversion() );
|
||||
array_push( $cau_configs, "DB: ".get_option( "cau_db_version" ).' / '.cau_db_version() );
|
||||
echo "<textarea style='width: 100%; height: 750px;'>";
|
||||
print_r( $cau_configs );
|
||||
echo "</textarea>";
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
<script>jQuery( '.toggle_advanced_button' ).click( function() { jQuery( '.toggle_advanced_content' ).toggle(); });</script>
|
||||
|
||||
<!-- Delay updates -->
|
||||
<table class="autoupdate cau_status_list widefat striped cau_status_warnings">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th><strong><?php _e( 'Delay updates', 'companion-auto-update' ); ?></strong> ‐ <?php echo ( cau_get_db_value( 'update_delay' ) == 'on' ) ? __( 'Enabled', 'companion-auto-update' ).' ('.sprintf( esc_html__( '%s days', 'companion-auto-update' ).')', cau_get_db_value( 'update_delay_days' ) ) : __( 'Disabled', 'companion-auto-update' ); ?></th>
|
||||
<th><?php _e( 'Till', 'companion-auto-update' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody id="the-list">
|
||||
<?php
|
||||
|
||||
$updateLog = "{$wpdb->prefix}update_log";
|
||||
$put_on_hold = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$updateLog} WHERE put_on_hold <> '%s'", '0' ) );
|
||||
|
||||
foreach ( $put_on_hold as $plugin ) {
|
||||
|
||||
$__name = $plugin->slug;
|
||||
$__poh = $plugin->put_on_hold;
|
||||
$__udd = ( cau_get_db_value( 'update_delay_days' ) != '' ) ? cau_get_db_value( 'update_delay_days' ) : '2';
|
||||
$__date = date_i18n( $dateFormat, strtotime( "+".$__udd." days", $__poh ) );
|
||||
|
||||
echo "<tr>
|
||||
<td>{$__name}</td>
|
||||
<td>{$__date}</td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
echo empty( $put_on_hold ) ? "<tr><td>".__( 'No plugins have been put on hold.', 'companion-auto-update' )."</td></tr>" : "";
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// Remove the line
|
||||
if( isset( $_POST['fixit'] ) ) {
|
||||
check_admin_referer( 'cau_fixit' );
|
||||
cau_removeErrorLine();
|
||||
}
|
||||
|
||||
// Get wp-config location
|
||||
function cau_configFile() {
|
||||
|
||||
// Config file
|
||||
if ( file_exists( ABSPATH . 'wp-config.php') ) {
|
||||
$conFile = ABSPATH . 'wp-config.php';
|
||||
} else {
|
||||
$conFile = dirname(ABSPATH) . '/wp-config.php';
|
||||
}
|
||||
|
||||
return $conFile;
|
||||
|
||||
}
|
||||
|
||||
// Change the AUTOMATIC_UPDATER_DISABLED line
|
||||
function cau_removeErrorLine() {
|
||||
|
||||
// Config file
|
||||
$conFile = cau_configFile();
|
||||
|
||||
// Lines to check and replace
|
||||
$revLine = "define('AUTOMATIC_UPDATER_DISABLED', false);"; // We could just remove the line, but replacing it will be safer
|
||||
$posibleLines = array( "define( 'AUTOMATIC_UPDATER_DISABLED', true );", "define( 'AUTOMATIC_UPDATER_DISABLED', minor );" ); // The two base options
|
||||
foreach ( $posibleLines as $value ) array_push( $posibleLines, strtolower( $value ) ); // Support lowercase variants
|
||||
foreach ( $posibleLines as $value ) array_push( $posibleLines, str_replace( ' ', '', $value ) ); // For variants without spaces
|
||||
|
||||
$melding = __( "We couldn't fix the error for you. Please contact us for further support", 'companion-auto-update' ).'.';
|
||||
$meldingS = 'error';
|
||||
|
||||
// Check for each string if it exists
|
||||
foreach ( $posibleLines as $key => $string ) {
|
||||
|
||||
if( strpos( file_get_contents( $conFile ), $string ) !== false) {
|
||||
$contents = file_get_contents( $conFile );
|
||||
$contents = str_replace( $string, $revLine, $contents );
|
||||
file_put_contents( $conFile, $contents );
|
||||
$melding = __( "We've fixed the error for you", 'companion-auto-update' ).' :)';
|
||||
$meldingS = 'updated';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo "<div id='message' class='$meldingS'><p><strong>$melding</strong></p></div>";
|
||||
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
|
||||
<svg
|
||||
|
||||
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
|
||||
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
|
||||
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
|
||||
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
|
||||
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
||||
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
|
||||
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
|
||||
|
||||
height="417pt"
|
||||
|
||||
|
||||
viewBox="0 -46 417.81333 417"
|
||||
|
||||
|
||||
width="417pt"
|
||||
|
||||
|
||||
version="1.1"
|
||||
|
||||
|
||||
id="svg4"
|
||||
|
||||
|
||||
sodipodi:docname="check.svg"
|
||||
|
||||
|
||||
inkscape:version="0.92.0 r15299">
|
||||
|
||||
|
||||
<metadata
|
||||
|
||||
|
||||
id="metadata10">
|
||||
|
||||
|
||||
<rdf:RDF>
|
Before Width: | Height: | Size: 2.1 KiB |
@ -1,96 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
|
||||
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<svg
|
||||
|
||||
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
|
||||
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
|
||||
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
|
||||
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
|
||||
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
||||
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
|
||||
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
|
||||
|
||||
version="1.1"
|
||||
|
||||
|
||||
id="Layer_1"
|
||||
|
||||
|
||||
x="0px"
|
||||
|
||||
|
||||
y="0px"
|
||||
|
||||
|
||||
viewBox="0 0 505 505"
|
||||
|
||||
|
||||
style="enable-background:new 0 0 505 505;"
|
||||
|
||||
|
||||
xml:space="preserve"
|
||||
|
||||
|
||||
sodipodi:docname="email.svg"
|
||||
|
||||
|
||||
inkscape:version="0.92.0 r15299"><metadata
|
||||
|
||||
|
||||
id="metadata43"><rdf:RDF><cc:Work
|
||||
|
||||
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
|
||||
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
|
||||
|
||||
|
||||
id="defs41" /><sodipodi:namedview
|
||||
|
||||
|
||||
pagecolor="#ffffff"
|
||||
|
||||
|
||||
bordercolor="#666666"
|
||||
|
||||
|
||||
borderopacity="1"
|
||||
|
||||
|
||||
objecttolerance="10"
|
||||
|
||||
|
||||
gridtolerance="10"
|
||||
|
||||
|
||||
guidetolerance="10"
|
||||
|
||||
|
||||
inkscape:pageopacity="0"
|
||||
|
||||
|
||||
inkscape:pageshadow="2"
|
||||
|
||||
|
Before Width: | Height: | Size: 4.8 KiB |
@ -1,67 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
|
||||
<svg
|
||||
|
||||
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
|
||||
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
|
||||
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
|
||||
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
|
||||
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
||||
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
|
||||
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
|
||||
|
||||
height="512pt"
|
||||
|
||||
|
||||
viewBox="0 0 512 512"
|
||||
|
||||
|
||||
width="512pt"
|
||||
|
||||
|
||||
version="1.1"
|
||||
|
||||
|
||||
id="svg6"
|
||||
|
||||
|
||||
sodipodi:docname="help.svg"
|
||||
|
||||
|
||||
inkscape:version="0.92.0 r15299">
|
||||
|
||||
|
||||
<metadata
|
||||
|
||||
|
||||
id="metadata12">
|
||||
|
||||
|
||||
<rdf:RDF>
|
||||
|
||||
|
||||
<cc:Work
|
||||
|
||||
|
||||
rdf:about="">
|
||||
|
||||
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
|
||||
|
||||
<dc:type
|
Before Width: | Height: | Size: 3.1 KiB |
@ -1,69 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
|
||||
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<svg
|
||||
|
||||
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
|
||||
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
|
||||
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
|
||||
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
|
||||
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
||||
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
|
||||
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
|
||||
|
||||
version="1.1"
|
||||
|
||||
|
||||
id="Layer_1"
|
||||
|
||||
|
||||
x="0px"
|
||||
|
||||
|
||||
y="0px"
|
||||
|
||||
|
||||
viewBox="0 0 512 512"
|
||||
|
||||
|
||||
style="enable-background:new 0 0 512 512;"
|
||||
|
||||
|
||||
xml:space="preserve"
|
||||
|
||||
|
||||
width="512"
|
||||
|
||||
|
||||
height="512"
|
||||
|
||||
|
||||
sodipodi:docname="interval.svg"
|
||||
|
||||
|
||||
inkscape:version="0.92.0 r15299"><metadata
|
||||
|
||||
|
||||
id="metadata39"><rdf:RDF><cc:Work
|
||||
|
||||
|
Before Width: | Height: | Size: 3.5 KiB |
@ -1,116 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
|
||||
<svg
|
||||
|
||||
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
|
||||
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
|
||||
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
|
||||
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
|
||||
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
||||
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
|
||||
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
|
||||
|
||||
id="Capa_1"
|
||||
|
||||
|
||||
enable-background="new 0 0 512 512"
|
||||
|
||||
|
||||
height="512"
|
||||
|
||||
|
||||
viewBox="0 0 512 512"
|
||||
|
||||
|
||||
width="512"
|
||||
|
||||
|
||||
version="1.1"
|
||||
|
||||
|
||||
sodipodi:docname="love.svg"
|
||||
|
||||
|
||||
inkscape:version="0.92.0 r15299">
|
||||
|
||||
|
||||
<metadata
|
||||
|
||||
|
||||
id="metadata97">
|
||||
|
||||
|
||||
<rdf:RDF>
|
||||
|
||||
|
||||
<cc:Work
|
||||
|
||||
|
||||
rdf:about="">
|
||||
|
||||
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
|
||||
|
||||
<dc:type
|
||||
|
||||
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
|
||||
|
||||
</cc:Work>
|
||||
|
||||
|
||||
</rdf:RDF>
|
||||
|
||||
|
||||
</metadata>
|
||||
|
||||
|
||||
<defs
|
||||
|
||||
|
||||
id="defs95" />
|
||||
|
||||
|
||||
<sodipodi:namedview
|
||||
|
||||
|
||||
pagecolor="#ffffff"
|
||||
|
||||
|
||||
bordercolor="#666666"
|
||||
|
||||
|
||||
borderopacity="1"
|
||||
|
||||
|
||||
objecttolerance="10"
|
||||
|
||||
|
||||
gridtolerance="10"
|
||||
|
||||
|
||||
guidetolerance="10"
|
||||
|
||||
|
||||
inkscape:pageopacity="0"
|
||||
|
||||
|
||||
inkscape:pageshadow="2"
|
||||
|
Before Width: | Height: | Size: 6.0 KiB |
@ -1,124 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
|
||||
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<svg
|
||||
|
||||
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
|
||||
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
|
||||
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
|
||||
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
|
||||
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
||||
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
|
||||
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
|
||||
|
||||
version="1.1"
|
||||
|
||||
|
||||
id="Layer_1"
|
||||
|
||||
|
||||
x="0px"
|
||||
|
||||
|
||||
y="0px"
|
||||
|
||||
|
||||
viewBox="0 0 505 505"
|
||||
|
||||
|
||||
style="enable-background:new 0 0 505 505;"
|
||||
|
||||
|
||||
xml:space="preserve"
|
||||
|
||||
|
||||
sodipodi:docname="settings.svg"
|
||||
|
||||
|
||||
inkscape:version="0.92.0 r15299"><metadata
|
||||
|
||||
|
||||
id="metadata43"><rdf:RDF><cc:Work
|
||||
|
||||
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
|
||||
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
|
||||
|
||||
id="defs41" /><sodipodi:namedview
|
||||
|
||||
|
||||
pagecolor="#ffffff"
|
||||
|
||||
|
||||
bordercolor="#666666"
|
||||
|
||||
|
||||
borderopacity="1"
|
||||
|
||||
|
||||
objecttolerance="10"
|
||||
|
||||
|
||||
gridtolerance="10"
|
||||
|
||||
|
||||
guidetolerance="10"
|
||||
|
||||
|
||||
inkscape:pageopacity="0"
|
||||
|
||||
|
||||
inkscape:pageshadow="2"
|
||||
|
||||
|
||||
inkscape:window-width="1920"
|
||||
|
||||
|
||||
inkscape:window-height="1017"
|
||||
|
||||
|
||||
id="namedview39"
|
||||
|
||||
|
||||
showgrid="false"
|
||||
|
||||
|
||||
inkscape:zoom="0.3304499"
|
||||
|
||||
|
||||
inkscape:cx="-433.02666"
|
||||
|
||||
|
||||
inkscape:cy="120.52743"
|
||||
|
||||
|
||||
inkscape:window-x="-8"
|
||||
|
||||
|
||||
inkscape:window-y="-8"
|
||||
|
||||
|
||||
inkscape:window-maximized="1"
|
Before Width: | Height: | Size: 9.3 KiB |
@ -1,102 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
|
||||
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<svg
|
||||
|
||||
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
|
||||
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
|
||||
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
|
||||
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
|
||||
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
||||
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
|
||||
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
|
||||
|
||||
version="1.1"
|
||||
|
||||
|
||||
id="Capa_1"
|
||||
|
||||
|
||||
x="0px"
|
||||
|
||||
|
||||
y="0px"
|
||||
|
||||
|
||||
viewBox="0 0 512 512"
|
||||
|
||||
|
||||
style="enable-background:new 0 0 512 512;"
|
||||
|
||||
|
||||
xml:space="preserve"
|
||||
|
||||
|
||||
sodipodi:docname="support.svg"
|
||||
|
||||
|
||||
inkscape:version="0.92.0 r15299"><metadata
|
||||
|
||||
|
||||
id="metadata75"><rdf:RDF><cc:Work
|
||||
|
||||
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
|
||||
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||
|
||||
|
||||
id="defs73" /><sodipodi:namedview
|
||||
|
||||
|
||||
pagecolor="#ffffff"
|
||||
|
||||
|
||||
bordercolor="#666666"
|
||||
|
||||
|
||||
borderopacity="1"
|
||||
|
||||
|
||||
objecttolerance="10"
|
||||
|
||||
|
||||
gridtolerance="10"
|
||||
|
||||
|
||||
guidetolerance="10"
|
||||
|
||||
|
||||
inkscape:pageopacity="0"
|
||||
|
||||
|
||||
inkscape:pageshadow="2"
|
||||
|
||||
|
||||
inkscape:window-width="2560"
|
||||
|
||||
|
||||
inkscape:window-height="1017"
|
||||
|
||||
|
Before Width: | Height: | Size: 5.2 KiB |
@ -1,91 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
|
||||
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<svg
|
||||
|
||||
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
|
||||
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
|
||||
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
|
||||
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
|
||||
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
||||
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
|
||||
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
|
||||
|
||||
version="1.1"
|
||||
|
||||
|
||||
id="Layer_1"
|
||||
|
||||
|
||||
x="0px"
|
||||
|
||||
|
||||
y="0px"
|
||||
|
||||
|
||||
viewBox="0 0 505 505"
|
||||
|
||||
|
||||
style="enable-background:new 0 0 505 505;"
|
||||
|
||||
|
||||
xml:space="preserve"
|
||||
|
||||
|
||||
sodipodi:docname="update.svg"
|
||||
|
||||
|
||||
inkscape:version="0.92.0 r15299"><metadata
|
||||
|
||||
|
||||
id="metadata43"><rdf:RDF><cc:Work
|
||||
|
||||
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
|
||||
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||
|
||||
|
||||
id="defs41" /><sodipodi:namedview
|
||||
|
||||
|
||||
pagecolor="#ffffff"
|
||||
|
||||
|
||||
bordercolor="#666666"
|
||||
|
||||
|
||||
borderopacity="1"
|
||||
|
||||
|
||||
objecttolerance="10"
|
||||
|
||||
|
||||
gridtolerance="10"
|
||||
|
||||
|
||||
guidetolerance="10"
|
||||
|
||||
|
||||
inkscape:pageopacity="0"
|
Before Width: | Height: | Size: 4.4 KiB |
@ -1,181 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
|
||||
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<svg
|
||||
|
||||
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
|
||||
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
|
||||
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
|
||||
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
|
||||
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
||||
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
|
||||
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
|
||||
|
||||
version="1.1"
|
||||
|
||||
|
||||
id="Capa_1"
|
||||
|
||||
|
||||
x="0px"
|
||||
|
||||
|
||||
y="0px"
|
||||
|
||||
|
||||
viewBox="0 0 512.001 512.001"
|
||||
|
||||
|
||||
style="enable-background:new 0 0 512.001 512.001;"
|
||||
|
||||
|
||||
xml:space="preserve"
|
||||
|
||||
|
||||
sodipodi:docname="welcome.svg"
|
||||
|
||||
|
||||
inkscape:version="0.92.0 r15299"><metadata
|
||||
|
||||
|
||||
id="metadata99"><rdf:RDF><cc:Work
|
||||
|
||||
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
|
||||
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||
|
||||
|
||||
id="defs97" /><sodipodi:namedview
|
||||
|
||||
|
||||
pagecolor="#ffffff"
|
||||
|
||||
|
||||
bordercolor="#666666"
|
||||
|
||||
|
||||
borderopacity="1"
|
||||
|
||||
|
||||
objecttolerance="10"
|
||||
|
||||
|
||||
gridtolerance="10"
|
||||
|
||||
|
||||
guidetolerance="10"
|
||||
|
||||
|
||||
inkscape:pageopacity="0"
|
||||
|
||||
|
||||
inkscape:pageshadow="2"
|
||||
|
||||
|
||||
inkscape:window-width="1920"
|
||||
|
||||
|
||||
inkscape:window-height="1017"
|
||||
|
||||
|
||||
id="namedview95"
|
||||
|
||||
|
||||
showgrid="false"
|
||||
|
||||
|
||||
inkscape:zoom="1.3037256"
|
||||
|
||||
|
||||
inkscape:cx="154.95189"
|
||||
|
||||
|
||||
inkscape:cy="223.3697"
|
||||
|
||||
|
||||
inkscape:window-x="-8"
|
||||
|
||||
|
||||
inkscape:window-y="-8"
|
||||
|
||||
|
||||
inkscape:window-maximized="1"
|
||||
|
||||
|
||||
inkscape:current-layer="Capa_1" /><circle
|
||||
|
||||
|
||||
style="fill:#ded1f2;fill-opacity:1;stroke-width:0.8621738"
|
||||
|
||||
|
||||
cx="256.00003"
|
||||
|
||||
|
||||
cy="252.93185"
|
||||
|
||||
|
||||
r="220.71649"
|
||||
|
||||
|
||||
id="circle2" /><g
|
||||
|
||||
|
||||
id="g20"
|
||||
|
||||
|
||||
transform="matrix(0.86217384,0,0,0.86217384,35.283516,32.215367)"><path
|
||||
|
||||
|
||||
style="fill:#34abe0"
|
||||
|
||||
|
||||
d="m 469.869,206.196 c -3.882,0 -7.029,-3.147 -7.029,-7.029 v -11.259 c 0,-3.882 3.147,-7.029 7.029,-7.029 3.882,0 7.029,3.147 7.029,7.029 v 11.259 c -0.001,3.883 -3.148,7.029 -7.029,7.029 z"
|
||||
|
||||
|
||||
id="path4"
|
||||
|
||||
|
||||
inkscape:connector-curvature="0" /><path
|
||||
|
||||
|
||||
style="fill:#34abe0"
|
||||
|
||||
|
||||
d="m 469.869,263.776 c -3.882,0 -7.029,-3.147 -7.029,-7.029 V 245.49 c 0,-3.882 3.147,-7.029 7.029,-7.029 3.882,0 7.029,3.147 7.029,7.029 v 11.258 c -0.001,3.881 -3.148,7.028 -7.029,7.028 z"
|
||||
|
||||
|
||||
id="path6"
|
||||
|
||||
|
||||
inkscape:connector-curvature="0" /><path
|
||||
|
||||
|
||||
style="fill:#34abe0"
|
||||
|
||||
|
||||
d="m 504.288,229.358 h -11.259 c -3.882,0 -7.029,-3.147 -7.029,-7.029 0,-3.882 3.147,-7.029 7.029,-7.029 h 11.259 c 3.882,0 7.029,3.147 7.029,7.029 0,3.881 -3.148,7.029 -7.029,7.029 z"
|
||||
|
||||
|
||||
id="path8"
|
Before Width: | Height: | Size: 12 KiB |
@ -1,582 +0,0 @@
|
||||
/* Default Stylings */
|
||||
.nowrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.cau_spacing {
|
||||
height: 25px;
|
||||
}
|
||||
.cau_support_buttons {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* Welcome screen */
|
||||
.welcome-to-cau {
|
||||
background: #FFF;
|
||||
border: 1px solid #CCD0D4;
|
||||
margin: 25px 0;
|
||||
padding: 30px;
|
||||
background-size: 140px;
|
||||
background-position: left bottom;
|
||||
background-repeat: no-repeat;
|
||||
box-shadow: 0 1px 1px rgba(0,0,0,.04);
|
||||
}
|
||||
.welcome-to-cau .welcome-image {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background-image: url('images/welcome.svg');
|
||||
background-size: contain;
|
||||
background-position: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.welcome-to-cau .welcome-content {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: calc(100% - 100px);
|
||||
padding-left: 25px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.welcome-to-cau .welcome-content strong {
|
||||
color: #000;
|
||||
}
|
||||
.welcome-to-cau .welcome-content p {
|
||||
margin: 2px 0;
|
||||
}
|
||||
.welcome-to-cau.help-bg {
|
||||
background-image: url('images/help.svg');
|
||||
}
|
||||
.welcome-to-cau.support-bg {
|
||||
background-image: url('images/support.svg');
|
||||
}
|
||||
.welcome-to-cau.love-bg {
|
||||
background-image: url('images/love.svg');
|
||||
}
|
||||
.welcome-to-cau.update-bg {
|
||||
background-image: url('images/update.svg');
|
||||
}
|
||||
.welcome-to-cau.email-bg {
|
||||
background-image: url('images/email.svg');
|
||||
}
|
||||
.welcome-to-cau.interval-bg {
|
||||
background-image: url('images/interval.svg');
|
||||
}
|
||||
.welcome-to-cau.advanced-bg {
|
||||
background-image: url('images/settings.svg');
|
||||
}
|
||||
.welcome-to-cau h2 {
|
||||
margin: 0;
|
||||
margin-bottom: 25px;
|
||||
font-size: 21px;
|
||||
font-weight: 400;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.welcome-to-cau h2.title {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.welcome-to-cau h3 {
|
||||
font-size: 16px;
|
||||
margin-top: 0;
|
||||
}
|
||||
.welcome-to-cau a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.welcome-to-cau .welcome-column {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.welcome-to-cau.cau-show-love .welcome-column {
|
||||
vertical-align: middle;
|
||||
}
|
||||
.welcome-to-cau .welcome-column.welcome-column-first {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
.first-column {
|
||||
padding-left: 140px;
|
||||
}
|
||||
.welcome-to-cau .welcome-column.welcome-column-half {
|
||||
width: 50%;
|
||||
}
|
||||
.welcome-to-cau .welcome-column.welcome-column-third {
|
||||
width: 33%;
|
||||
}
|
||||
.welcome-to-cau .welcome-column.welcome-column-quarter {
|
||||
width: 25%;
|
||||
}
|
||||
.welcome-to-cau a.minimal-button {
|
||||
display: inline-block;
|
||||
padding: 5px;
|
||||
}
|
||||
select.schedule_interval {
|
||||
max-width: 90%;
|
||||
width: 225px;
|
||||
}
|
||||
.cau_save_button.fixed_button {
|
||||
background: #FFF;
|
||||
box-sizing: border-box;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
margin-left: -25px;
|
||||
z-index: 1001;
|
||||
padding: 5px;
|
||||
box-shadow: 0 -8px 16px 0 rgb(85 93 102 / 30%);
|
||||
}
|
||||
.cau_save_button.fixed_button p.submit {
|
||||
display: block;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.cau_save_button.fixed_button p.submit input {
|
||||
width: 100%;
|
||||
max-width: 250px;
|
||||
height: 100%;
|
||||
padding: 5px;
|
||||
}
|
||||
.cau_save_button__space {
|
||||
height: 75px;
|
||||
}
|
||||
|
||||
/* Overwrite core UI */
|
||||
/*.cau_content input[type="checkbox"]:checked::before {
|
||||
content: "";
|
||||
background: url( 'images/check.svg' );
|
||||
background-size: contain;
|
||||
background-position: center center;
|
||||
}*/
|
||||
.cau_content a {
|
||||
color: #9178B7;
|
||||
}
|
||||
.cau_content a.nav-tab {
|
||||
color: #23282D;
|
||||
}
|
||||
.cau_content .button-primary {
|
||||
background-color: #9178B7!important;
|
||||
border-color: #9178B7!important;
|
||||
}
|
||||
.cau_content .button-alt {
|
||||
color: #9178B7!important;
|
||||
border-color: #9178B7!important;
|
||||
}
|
||||
.cau_content .button-hero {
|
||||
font-weight: 500;
|
||||
padding: 2px 15px!important;
|
||||
}
|
||||
#message.cau {
|
||||
background: #FFF;
|
||||
border: 1px solid #CCD0D4;
|
||||
border-left-width: 4px;
|
||||
border-left-color: #9178B7;
|
||||
box-shadow: 0 1px 1px rgba(0,0,0,.04);
|
||||
margin: 25px 0px 5px 0;
|
||||
padding: 15px;
|
||||
}
|
||||
#message.cau a, #message.cau strong {
|
||||
color: #9178B7;
|
||||
}
|
||||
|
||||
/* Dashboard */
|
||||
.cau-column-wide {
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: calc(100% - 450px);
|
||||
padding-right: 25px;
|
||||
}
|
||||
.cau-column-small {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 450px;
|
||||
}
|
||||
.cau-dashboard-box {
|
||||
background-position: right bottom;
|
||||
}
|
||||
.cau-column-wide .cau-dashboard-box {
|
||||
padding-right: 125px;
|
||||
}
|
||||
.cau-dashboard-box a {
|
||||
margin-left: 0px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.cau-dashboard-box .welcome-column {
|
||||
padding-right: 25px;
|
||||
}
|
||||
.support-sidebar-list {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
.cau_content .nav-tab {
|
||||
position: relative;
|
||||
}
|
||||
.cau_content .nav-tab .cau_melding {
|
||||
display: inline-block;
|
||||
width: 11px;
|
||||
height: 11px;
|
||||
border-radius: 10px;
|
||||
margin-left: 5px;
|
||||
position: relative;
|
||||
bottom: -1px;
|
||||
}
|
||||
.cau_content .nav-tab .cau_melding.level-okay {
|
||||
background: #7AD03A;
|
||||
}
|
||||
.cau_content .nav-tab .cau_melding.level-low {
|
||||
background: #FFBA00;
|
||||
}
|
||||
.cau_content .nav-tab .cau_melding.level-high {
|
||||
background: #FF0000;
|
||||
}
|
||||
|
||||
/* Table Styling */
|
||||
.cau_content .widefat td {
|
||||
vertical-align: middle!important;
|
||||
}
|
||||
table.autoupdate th.head-plugin {
|
||||
min-width: 250px;
|
||||
}
|
||||
table.autoupdate th.head-status {
|
||||
min-width: 150px;
|
||||
}
|
||||
table.autoupdate th.check-column {
|
||||
position: relative;
|
||||
min-width: 55px;
|
||||
}
|
||||
table.autoupdate tr.inactive {
|
||||
background: #FEF7F1;
|
||||
}
|
||||
table.autoupdate tr.active .check-column {
|
||||
border-left: 3px solid transparent;
|
||||
}
|
||||
table.autoupdate tr.inactive .check-column {
|
||||
border-left: 3px solid #D54E21;
|
||||
}
|
||||
table.autoupdate tr.inactive td.column-status p {
|
||||
color: #BF3D3C;
|
||||
}
|
||||
table.autoupdate tr.active td.column-status p {
|
||||
color: #000;
|
||||
}
|
||||
table.autoupdate tr td.column-description p {
|
||||
overflow: hidden;
|
||||
max-height: 18px;
|
||||
}
|
||||
|
||||
/* Update Log */
|
||||
table.autoupdatelog {
|
||||
margin-top: 25px;
|
||||
}
|
||||
table.autoupdatelog strong {
|
||||
color: #000;
|
||||
}
|
||||
table.autoupdatelog .dashicons {
|
||||
color: #00A0D2;
|
||||
}
|
||||
|
||||
/* Status */
|
||||
table.cau_status_list {
|
||||
margin-top: 25px;
|
||||
}
|
||||
table.cau_status_list:not(.no_column_width) th, table.cau_status_list:not(.no_column_width) td {
|
||||
width: 25%;
|
||||
}
|
||||
.cau_enabled {
|
||||
color: #7AD03A;
|
||||
}
|
||||
.cau_disabled {
|
||||
color: #FF0000;
|
||||
}
|
||||
.cau_warning {
|
||||
color: #FFBA00;
|
||||
}
|
||||
.cau_mobile_prefix {
|
||||
display: none;
|
||||
}
|
||||
table.cau_status_list .cau_status_icon {
|
||||
width: 50px!important;
|
||||
}
|
||||
table.cau_status_list .cau_status_icon .dashicons, table.cau_status_list .cau_status_icon .dashicons-before:before {
|
||||
height: 25px;
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
/* Rollback list */
|
||||
table.rollbacklist {
|
||||
max-width: 650px;
|
||||
}
|
||||
table.rollbacklist td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
table.rollbacklist td a.versionselectbutton {
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Plugin list */
|
||||
.pluginListButtons {
|
||||
display: block;
|
||||
padding: 15px 0;
|
||||
}
|
||||
.pluginListButtons p.submit {
|
||||
display: inline-block;
|
||||
margin: 0!important;
|
||||
padding: 0!important;
|
||||
}
|
||||
.cau_content #the-list input[type="checkbox"]:not(:checked), .cau_content #the-list input[type="checkbox"]:checked {
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 100;
|
||||
display: block;
|
||||
opacity: 0;
|
||||
}
|
||||
.cau_content #the-list input[type="checkbox"]:not(:checked) + label, .cau_content #the-list input[type="checkbox"]:checked + label {
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
left: 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.cau_content #the-list input[type="checkbox"]:not(:checked) + label:before, .cau_content #the-list input[type="checkbox"]:checked + label:before, .cau_content #the-list input[type="checkbox"]:not(:checked) + label:after, .cau_content #the-list input[type="checkbox"]:checked + label:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
}
|
||||
.cau_content #the-list input[type="checkbox"]:not(:checked) + label:before, .cau_content #the-list input[type="checkbox"]:checked + label:before {
|
||||
left: 0;
|
||||
top: -3px;
|
||||
width: 30px;
|
||||
height: 16px;
|
||||
background: transparent;
|
||||
border: 2px solid #9178B7;
|
||||
border-radius: 15px;
|
||||
transition: background-color .2s;
|
||||
}
|
||||
.cau_content #the-list input[type="checkbox"]:not(:checked) + label:after, .cau_content #the-list input[type="checkbox"]:checked + label:after {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
transition: all .2s;
|
||||
border-radius: 500px;
|
||||
background: transparent;
|
||||
border: 2px solid #9178B7;
|
||||
top: 1px;
|
||||
left: 5px;
|
||||
}
|
||||
.cau_content #the-list input[type="checkbox"]:not(:checked) + label:before {
|
||||
background: #9178B7;
|
||||
border: 2px solid #9178B7;
|
||||
}
|
||||
.cau_content #the-list input[type="checkbox"]:not(:checked) + label:after {
|
||||
background: #9178B7;
|
||||
border-color: #FFF;
|
||||
left: 18px;
|
||||
}
|
||||
|
||||
/* Scheduling */
|
||||
.cau_schedule_input {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 50px;
|
||||
padding-top: 5px;
|
||||
}
|
||||
.cau_schedule_input input {
|
||||
max-width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
.cau_schedule_input_div {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
padding: 0 6px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.cau_shedule_notation {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 125px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.cau_shedule_notation .dashicons {
|
||||
position: relative;
|
||||
bottom: -5px;
|
||||
}
|
||||
|
||||
/* Tooltip */
|
||||
.cau_tooltip {
|
||||
position: relative;
|
||||
}
|
||||
.cau_tooltip .cau_tooltip_text {
|
||||
visibility: hidden;
|
||||
background-color: rgba(0,0,0,0.7);
|
||||
color: #FFF;
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
padding: 15px;
|
||||
border-radius: 6px;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
width: 240px;
|
||||
bottom: 100%;
|
||||
left: 50%;
|
||||
margin-left: -60px;
|
||||
margin-bottom: 10px;
|
||||
opacity: 0;
|
||||
transition: .3s;
|
||||
font-weight: normal;
|
||||
}
|
||||
.cau_tooltip:hover .cau_tooltip_text {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
.cau_tooltip .cau_tooltip_text::after {
|
||||
content: " ";
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
margin-left: -75px;
|
||||
border-width: 5px;
|
||||
border-style: solid;
|
||||
border-color: rgba(0,0,0,0.7) transparent transparent transparent;
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
@media screen and (max-width: 1400px) {
|
||||
|
||||
.cau-column-wide {
|
||||
width: calc(100% - 350px);
|
||||
}
|
||||
.cau-column-small {
|
||||
width: 350px;
|
||||
}
|
||||
.welcome-to-cau .welcome-column.welcome-column-quarter {
|
||||
width: 50%;
|
||||
padding-bottom: 35px;
|
||||
}
|
||||
.cau-column-small .welcome-to-cau {
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
}
|
||||
@media screen and (max-width: 1150px) {
|
||||
|
||||
.cau-column-wide, .cau-column-small {
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
}
|
||||
@media screen and (max-width: 1000px) {
|
||||
|
||||
/* Basics */
|
||||
.cau_hide_on_mobile, table.autoupdate thead {
|
||||
display: none!important;
|
||||
}
|
||||
.form-table td fieldset p {
|
||||
display: block;
|
||||
padding: 5px 0;
|
||||
}
|
||||
.form-table td fieldset input[type="checkbox"] {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 25px;
|
||||
}
|
||||
.form-table td fieldset label {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: calc(100% - 40px);
|
||||
box-sizing: border-box;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.cau_content .nav-tab-wrapper {
|
||||
position: relative;
|
||||
top: -20px;
|
||||
border-bottom: 1px solid #CCC!important;
|
||||
padding-bottom: 15px!important;
|
||||
margin-bottom: 0px!important;
|
||||
}
|
||||
.cau_content .nav-tab {
|
||||
font-size: 12px;
|
||||
margin: 5px 5px 0 0!important;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Scheduling */
|
||||
.cau_schedule_input {
|
||||
width: 75px;
|
||||
}
|
||||
|
||||
/* Custom buttons */
|
||||
.cau-button {
|
||||
display: block;
|
||||
text-align: center;
|
||||
margin: 5px 0;
|
||||
}
|
||||
.cau-button .dashicons {
|
||||
float: left;
|
||||
}
|
||||
|
||||
/* Dashboard */
|
||||
.welcome-to-cau {
|
||||
background-position: right bottom;
|
||||
}
|
||||
.welcome-to-cau.love-bg {
|
||||
background-image: none;
|
||||
}
|
||||
.welcome-to-cau .welcome-column {
|
||||
min-width: 100%;
|
||||
}
|
||||
.welcome-to-cau .welcome-column.welcome-column-first {
|
||||
padding-left: 0px;
|
||||
}
|
||||
.cau-column-wide .cau-dashboard-box {
|
||||
padding-right: 30px;
|
||||
padding-bottom: 125px
|
||||
}
|
||||
.majorMinorExplain {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Status */
|
||||
table.cau_status_list .cau_status_name {
|
||||
display: inline-block;
|
||||
width: 50%;
|
||||
box-sizing: border-box;
|
||||
font-weight: 500;
|
||||
}
|
||||
table.cau_status_list .cau_status_interval {
|
||||
display: none;
|
||||
}
|
||||
table.cau_status_list th.cau_status_next {
|
||||
display: none;
|
||||
}
|
||||
table.cau_status_list td.cau_status_next {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
table.cau_status_list .cau_status_active_state {
|
||||
display: inline-block;
|
||||
width: 50%;
|
||||
box-sizing: border-box;
|
||||
text-align: right;
|
||||
}
|
||||
.cau_mobile_prefix {
|
||||
display: inline-block;
|
||||
padding-right: 5px;
|
||||
}
|
||||
table.cau_status_list.cau_status_warnings td {
|
||||
display: block;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
table.cau_status_list.cau_status_warnings th.cau_plugin_issue_explain, table.cau_status_list.cau_status_warnings th.cau_plugin_issue_fixit {
|
||||
display: none;
|
||||
}
|
||||
table.cau_status_list.cau_status_warnings td.cau_plugin_issue_name {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
#wpadminbar #wp-admin-bar-cau-has-issues .ab-icon:before {
|
||||
|
||||
|
||||
/*content: "\f463";*/
|
||||
|
||||
|
||||
content: "\f332";
|
||||
|
||||
|
||||
top: 3px;
|
||||
|
@ -1,526 +0,0 @@
|
||||
<?php
|
||||
|
||||
// Check if emails should be send or not
|
||||
function cau_check_updates_mail() {
|
||||
|
||||
// Notify of pending updates
|
||||
if( cau_get_db_value( 'send' ) == 'on' ) {
|
||||
cau_list_theme_updates(); // Check for theme updates
|
||||
cau_list_plugin_updates(); // Check for plugin updates
|
||||
}
|
||||
|
||||
// Notify of completed updates
|
||||
if( cau_get_db_value( 'sendupdate' ) == 'on' && cau_get_db_value( 'plugins' ) == 'on' ) {
|
||||
cau_plugin_updated(); // Check for updated plugins
|
||||
}
|
||||
|
||||
// Notify of required db update
|
||||
if( cau_get_db_value( 'dbupdateemails' ) == 'on' ) {
|
||||
cau_notify_outofdate_db();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Notify of out of date software
|
||||
function cau_outdated_notifier_mail() {
|
||||
if( cau_get_db_value( 'sendoutdated' ) == 'on' ) {
|
||||
cau_list_outdated_software(); // Check for oudated plugins
|
||||
}
|
||||
}
|
||||
|
||||
// Ge the emailadresses it should be send to
|
||||
function cau_set_email() {
|
||||
|
||||
$emailArray = array();
|
||||
|
||||
if( cau_get_db_value( 'email' ) == '' ) {
|
||||
array_push( $emailArray, get_option('admin_email') );
|
||||
} else {
|
||||
$emailAdresses = cau_get_db_value( 'email' );
|
||||
$list = explode( ", ", $emailAdresses );
|
||||
foreach ( $list as $key ) {
|
||||
array_push( $emailArray, $list );
|
||||
}
|
||||
}
|
||||
|
||||
return $emailArray;
|
||||
|
||||
}
|
||||
|
||||
// Mail format
|
||||
function cau_is_html() {
|
||||
if ( !function_exists( 'cau_get_db_value' ) ) require_once( plugin_dir_path( __FILE__ ) . 'cau_function.php' );
|
||||
return ( cau_get_db_value( 'html_or_text' ) == 'html' ) ? true : false;
|
||||
}
|
||||
|
||||
// Set the content for the emails about pending updates
|
||||
function cau_outdated_message( $single, $plural, $list ) {
|
||||
|
||||
// WP version
|
||||
$wpversion = get_bloginfo( 'version' );
|
||||
|
||||
// Base text
|
||||
$text = sprintf( esc_html__( "You have %s on your WordPress site at %s that have not been tested with the latest 3 major releases of WordPress.", "companion-auto-update" ), $plural, get_site_url() );
|
||||
$text .= "\n";
|
||||
$text .= "\n";
|
||||
|
||||
// The list
|
||||
if( !empty( $list ) ) {
|
||||
|
||||
$text .= sprintf( esc_html__( "The following %s have not been tested with WordPress %s:", "companion-auto-update" ), $plural, $wpversion );
|
||||
$text .= "\n";
|
||||
$text .= "\n";
|
||||
|
||||
foreach ( $list as $plugin => $version ) {
|
||||
if( $version == '' ) $version = __( "Unknown", "companion-auto-update" );
|
||||
$text .= "- ".sprintf( esc_html__( "%s tested up to: %s", "companion-auto-update" ), $plugin, $version )."\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $text;
|
||||
|
||||
}
|
||||
|
||||
// Set the content for the emails about pending updates
|
||||
function cau_pending_message( $single, $plural, $list ) {
|
||||
|
||||
// What markup to use
|
||||
if( cau_is_html() ) $break = '<br />';
|
||||
else $break = "\n";
|
||||
|
||||
// Base text
|
||||
$text = sprintf( esc_html__( 'You have pending %1$s updates on your WordPress site at %2$s.', 'companion-auto-update' ), $single, get_site_url() );
|
||||
$text .= $break;
|
||||
|
||||
if( !empty( $list ) ) {
|
||||
|
||||
$text .= $break;
|
||||
$text .= sprintf( esc_html__( 'The following %1$s have new versions available.', 'companion-auto-update' ), $plural );
|
||||
$text .= $break;
|
||||
|
||||
if( cau_is_html() ) $text .= "<ol>";
|
||||
foreach ( $list as $key => $value ) {
|
||||
if( cau_is_html() ) {
|
||||
$text .= "<li>$value</li>";
|
||||
} else {
|
||||
$text .= "-$value\n";
|
||||
}
|
||||
}
|
||||
if( cau_is_html() ) $text .= "</ol>";
|
||||
|
||||
$text .= $break;
|
||||
}
|
||||
|
||||
$text .= __( 'Leaving your site outdated is a security risk so please consider manually updating them.', 'companion-auto-update' );
|
||||
$text .= $break;
|
||||
|
||||
// End
|
||||
$text .= sprintf( esc_html__( 'Head over to %1$s and check the ones you want to update.', 'companion-auto-update' ), get_admin_url().'update-core.php' );
|
||||
|
||||
return $text;
|
||||
|
||||
}
|
||||
|
||||
// Set the content for the emails about recent updates
|
||||
function cau_updated_message( $type, $updatedList ) {
|
||||
|
||||
// What markup to use
|
||||
if( cau_is_html() ) $break = '<br />';
|
||||
else $break = "\n";
|
||||
|
||||
// The message
|
||||
$text = sprintf( esc_html__(
|
||||
'One or more %1$s on your WordPress site at %2$s have been updated by Companion Auto Update. No further action is needed on your part.
|
||||
For more info on what is new visit your dashboard and check the changelog.', 'companion-auto-update'
|
||||
), $type, get_site_url() );
|
||||
|
||||
$text .= $break;
|
||||
$text .= $break;
|
||||
$text .= sprintf( esc_html__(
|
||||
'The following %1$s have been updated:', 'companion-auto-update'
|
||||
), $type );
|
||||
|
||||
$text .= $break;
|
||||
$text .= $updatedList;
|
||||
|
||||
$text .= $break;
|
||||
$text .= __( "(You'll also receive this email if you manually updated a plugin or theme)", "companion-auto-update" );
|
||||
|
||||
return $text;
|
||||
|
||||
}
|
||||
|
||||
// Checks if plugins are out of date
|
||||
function cau_list_outdated_software() {
|
||||
|
||||
// Check if cau_get_db_value() function exists.
|
||||
if ( !function_exists( 'cau_get_db_value' ) ) require_once( plugin_dir_path( __FILE__ ) . 'cau_function.php' );
|
||||
|
||||
// Set up mail
|
||||
$subject = '['.get_bloginfo( 'name' ).'] ' . __( 'You have outdated plugins on your site.', 'companion-auto-update' );
|
||||
$type = __( 'plugin', 'companion-auto-update' );
|
||||
$type_plural = __( 'plugins', 'companion-auto-update' );
|
||||
$message = cau_outdated_message( $type, $type_plural, cau_list_outdated() );
|
||||
|
||||
// Send to all addresses
|
||||
foreach ( cau_set_email() as $key => $value ) {
|
||||
foreach ( $value as $k => $v ) {
|
||||
wp_mail( $v, $subject, $message );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Checks if theme updates are available
|
||||
function cau_list_theme_updates() {
|
||||
|
||||
global $wpdb;
|
||||
$table_name = $wpdb->prefix . "auto_updates";
|
||||
|
||||
$configs = $wpdb->get_results( "SELECT * FROM $table_name WHERE name = 'themes'");
|
||||
foreach ( $configs as $config ) {
|
||||
|
||||
if( $config->onoroff != 'on' ) {
|
||||
|
||||
// Check for required files
|
||||
if ( !function_exists( 'get_theme_updates' ) ) {
|
||||
require_once ABSPATH . 'wp-admin/includes/update.php';
|
||||
}
|
||||
|
||||
// Begin
|
||||
$themes = get_theme_updates();
|
||||
$list = array();
|
||||
|
||||
if ( !empty( $themes ) ) {
|
||||
|
||||
foreach ( $themes as $stylesheet => $theme ) {
|
||||
array_push( $list, $theme->get( 'Name' ) );
|
||||
}
|
||||
|
||||
$subject = '[' . get_bloginfo( 'name' ) . '] ' . __( 'Theme update available.', 'companion-auto-update' );
|
||||
$type = __('theme', 'companion-auto-update');
|
||||
$type_plural = __('themes', 'companion-auto-update');
|
||||
$message = cau_pending_message( $type, $type_plural, $list );
|
||||
|
||||
foreach ( cau_set_email() as $key => $value) {
|
||||
foreach ($value as $k => $v) {
|
||||
wp_mail( $v, $subject, $message );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Checks if plugin updates are available
|
||||
function cau_list_plugin_updates() {
|
||||
|
||||
global $wpdb;
|
||||
$table_name = $wpdb->prefix . "auto_updates";
|
||||
|
||||
$configs = $wpdb->get_results( "SELECT * FROM $table_name WHERE name = 'plugins'");
|
||||
foreach ( $configs as $config ) {
|
||||
|
||||
if( $config->onoroff != 'on' ) {
|
||||
|
||||
require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
||||
|
||||
// Make sure get_plugin_updates() and get_plugins() are defined
|
||||
if ( !function_exists( 'get_plugin_updates' ) OR !function_exists( 'get_plugins' ) ) {
|
||||
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
||||
require_once ABSPATH . 'wp-admin/includes/update.php';
|
||||
}
|
||||
|
||||
// Begin
|
||||
$plugins = get_plugin_updates();
|
||||
|
||||
if ( !empty( $plugins ) ) {
|
||||
|
||||
$list = array();
|
||||
foreach ( (array) $plugins as $plugin_file => $plugin_data ) {
|
||||
$plugin_data = (object) _get_plugin_data_markup_translate( $plugin_file, (array) $plugin_data, false, true );
|
||||
$name = $plugin_data->Name;
|
||||
array_push( $list, $name );
|
||||
}
|
||||
|
||||
$subject = '[' . get_bloginfo( 'name' ) . '] ' . __( 'Plugin update available.', 'companion-auto-update' );
|
||||
$type = __( 'plugin', 'companion-auto-update' );
|
||||
$type_plural = __( 'plugins', 'companion-auto-update' );
|
||||
$message = cau_pending_message( $type, $type_plural, $list );
|
||||
|
||||
foreach ( cau_set_email() as $key => $value) {
|
||||
foreach ($value as $k => $v) {
|
||||
wp_mail( $v, $subject, $message );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Alerts when plugin has been updated
|
||||
function cau_plugin_updated() {
|
||||
|
||||
// Check if cau_get_db_value() function exists.
|
||||
if ( !function_exists( 'cau_get_db_value' ) ) require_once( plugin_dir_path( __FILE__ ) . 'cau_function.php' );
|
||||
|
||||
// Set the correct timezone for emails
|
||||
date_default_timezone_set( cau_get_proper_timezone() );
|
||||
|
||||
// Create arrays
|
||||
$pluginNames = array();
|
||||
$pluginDates = array();
|
||||
$pluginVersion = array();
|
||||
$pluginSlug = array();
|
||||
$pluginTimes = array();
|
||||
$themeNames = array();
|
||||
$themeDates = array();
|
||||
$themeTimes = array();
|
||||
|
||||
// Where to look for plugins
|
||||
$plugdir = plugin_dir_path( __DIR__ );
|
||||
if ( !function_exists( 'get_plugins' ) ) require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); // Check if get_plugins() function exists.
|
||||
$allPlugins = get_plugins();
|
||||
|
||||
// Where to look for themes
|
||||
$themedir = get_theme_root();
|
||||
$allThemes = wp_get_themes();
|
||||
|
||||
// Mail schedule
|
||||
$schedule_mail = wp_get_schedule( 'cau_set_schedule_mail' );
|
||||
|
||||
// Loop trough all plugins
|
||||
foreach ( $allPlugins as $key => $value ) {
|
||||
|
||||
// Get plugin data
|
||||
$fullPath = $plugdir.'/'.$key;
|
||||
$getFile = $path_parts = pathinfo( $fullPath );
|
||||
$pluginData = get_plugin_data( $fullPath );
|
||||
|
||||
// Get the slug
|
||||
$explosion = explode( '/', $key );
|
||||
$actualSlug = array_shift( $explosion );
|
||||
|
||||
// Get last update date
|
||||
$fileDate = date ( 'YmdHi', filemtime( $fullPath ) );
|
||||
|
||||
switch ( $schedule_mail ) {
|
||||
case 'hourly':
|
||||
$lastday = date( 'YmdHi', strtotime( '-1 hour', time() ) );
|
||||
break;
|
||||
case 'twicedaily':
|
||||
$lastday = date( 'YmdHi', strtotime( '-12 hours', time() ) );
|
||||
break;
|
||||
default:
|
||||
$lastday = date( 'YmdHi', strtotime( '-1 day', time() ) );
|
||||
break;
|
||||
}
|
||||
|
||||
$dateFormat = get_option( 'date_format' );
|
||||
$timestamp = date_i18n( $dateFormat, filemtime( $fullPath ) );
|
||||
$timestamp .= ' - '.date( 'H:i', filemtime( $fullPath ) );
|
||||
|
||||
if( $fileDate >= $lastday ) {
|
||||
|
||||
// Get plugin name
|
||||
foreach ( $pluginData as $dataKey => $dataValue ) {
|
||||
if( $dataKey == 'Name') {
|
||||
array_push( $pluginNames , $dataValue );
|
||||
}
|
||||
if( $dataKey == 'Version') {
|
||||
array_push( $pluginVersion , $dataValue );
|
||||
}
|
||||
}
|
||||
|
||||
array_push( $pluginDates, $fileDate );
|
||||
array_push( $pluginSlug, $actualSlug );
|
||||
array_push( $pluginTimes, $timestamp );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Loop trough all themes
|
||||
foreach ( $allThemes as $key => $value ) {
|
||||
|
||||
// Get theme data
|
||||
$fullPath = $themedir.'/'.$key;
|
||||
$getFile = $path_parts = pathinfo( $fullPath );
|
||||
|
||||
// Get last update date
|
||||
$dateFormat = get_option( 'date_format' );
|
||||
$fileDate = date ( 'YmdHi', filemtime( $fullPath ) );
|
||||
|
||||
if( $schedule_mail == 'hourly' ) {
|
||||
$lastday = date( 'YmdHi', strtotime( '-1 hour', time() ) );
|
||||
} elseif( $schedule_mail == 'twicedaily' ) {
|
||||
$lastday = date( 'YmdHi', strtotime( '-12 hours', time() ) );
|
||||
} elseif( $schedule_mail == 'daily' ) {
|
||||
$lastday = date( 'YmdHi', strtotime( '-1 day', time() ) );
|
||||
}
|
||||
|
||||
$dateFormat = get_option( 'date_format' );
|
||||
$timestamp = date_i18n( $dateFormat, filemtime( $fullPath ) );
|
||||
$timestamp .= ' - '.date( 'H:i', filemtime( $fullPath ) );
|
||||
|
||||
if( $fileDate >= $lastday ) {
|
||||
array_push( $themeNames, $path_parts['filename'] );
|
||||
array_push( $themeDates, $fileDate );
|
||||
array_push( $themeTimes, $timestamp );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$totalNumP = 0;
|
||||
$totalNumT = 0;
|
||||
$updatedListP = '';
|
||||
$updatedListT = '';
|
||||
|
||||
if( cau_get_db_value( 'html_or_text' ) == 'html' ) {
|
||||
$updatedListP .= '<ol>';
|
||||
$updatedListT .= '<ol>';
|
||||
}
|
||||
|
||||
foreach ( $pluginDates as $key => $value ) {
|
||||
|
||||
// Set up some var
|
||||
$plugin_name = $pluginNames[$key];
|
||||
$plugin_slug = $pluginSlug[$key];
|
||||
$to_version = __( "to version", "companion-auto-update" ).' '.$pluginVersion[$key];
|
||||
$more_info_arr = array( __( "Time of update", "companion-auto-update" ) => $pluginTimes[$key] );
|
||||
|
||||
// Plugin links
|
||||
if( cau_get_db_value( 'plugin_links_emails' ) == 'on' ) {
|
||||
$more_info_arr[__( "Plugin details", "companion-auto-update" )] = "<a href='https://wordpress.org/plugins/{$plugin_slug}/'>".__( "Visit", "companion-auto-update" )."</a>";
|
||||
$more_info_arr[__( "Release notes", "companion-auto-update" )] = "<a href='https://wordpress.org/plugins/{$plugin_slug}/#developers'>".__( "Visit", "companion-auto-update" )."</a>";
|
||||
$more_info_arr[__( "Support", "companion-auto-update" )] = "<a href='https://wordpress.org/support/plugin/{$plugin_slug}/'>".__( "Visit", "companion-auto-update" )."</a>";
|
||||
}
|
||||
|
||||
// Email format
|
||||
$use_html = ( cau_get_db_value( 'html_or_text' ) == 'html' ) ? true : false;
|
||||
|
||||
// Email content
|
||||
$updatedListP .= $use_html ? "<li>" : "-"; // Start row
|
||||
|
||||
$updatedListP .= $use_html ? "<strong>{$plugin_name}</strong> " : "{$plugin_name} "; // Show plugin name
|
||||
$updatedListP .= $to_version; // To version
|
||||
|
||||
// Get advanced info
|
||||
if( cau_get_db_value( 'advanced_info_emails' ) == 'on' ) {
|
||||
foreach( $more_info_arr as $label => $value ) {
|
||||
$updatedListP .= $use_html ? "<br />{$label}: {$value}" : "\n{$label}: {$value}";
|
||||
}
|
||||
}
|
||||
|
||||
$updatedListP .= $use_html ? "</li>" : "\n"; // End row
|
||||
|
||||
$totalNumP++;
|
||||
}
|
||||
|
||||
foreach ( $themeNames as $key => $value ) {
|
||||
|
||||
if( cau_get_db_value( 'html_or_text' ) == 'html' ) {
|
||||
|
||||
$more_info = '';
|
||||
if( cau_get_db_value( 'advanced_info_emails' ) == 'on' ) $more_info = "<br /><span style='opacity: 0.5;'>".__( "Time of update", "companion-auto-update" ).": ".$themeTimes[$key]."</span>";
|
||||
$updatedListT .= "<li><strong>".$themeNames[$key]."</strong>".$more_info."</li>";
|
||||
|
||||
} else {
|
||||
$updatedListT .= "- ".$themeNames[$key]."\n";
|
||||
}
|
||||
|
||||
$totalNumT++;
|
||||
}
|
||||
|
||||
if( cau_get_db_value( 'html_or_text' ) == 'html' ) {
|
||||
$updatedListP .= '</ol>';
|
||||
$updatedListT .= '</ol>';
|
||||
}
|
||||
|
||||
// Set the email content type
|
||||
if( cau_get_db_value( 'html_or_text' ) == 'html' ) {
|
||||
function cau_mail_content_type() {
|
||||
return 'text/html';
|
||||
}
|
||||
add_filter( 'wp_mail_content_type', 'cau_mail_content_type' );
|
||||
}
|
||||
|
||||
// If plugins have been updated, send email
|
||||
if( $totalNumP > 0 ) {
|
||||
|
||||
// E-mail content
|
||||
$subject = '[' . get_bloginfo( 'name' ) . '] ' . __('One or more plugins have been updated.', 'companion-auto-update');
|
||||
$type = __('plugins', 'companion-auto-update');
|
||||
$message = cau_updated_message( $type, $updatedListP );
|
||||
|
||||
// Send to all addresses
|
||||
foreach ( cau_set_email() as $key => $value) {
|
||||
foreach ($value as $k => $v) {
|
||||
wp_mail( $v, $subject, $message );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// If themes have been updated, send email
|
||||
if( $totalNumT > 0 ) {
|
||||
|
||||
// E-mail content
|
||||
$subject = '[' . get_bloginfo( 'name' ) . '] ' . __('One or more themes have been updated.', 'companion-auto-update');
|
||||
$type = __('themes', 'companion-auto-update');
|
||||
$message = cau_updated_message( $type, $updatedListT );
|
||||
|
||||
// Send to all addresses
|
||||
foreach ( cau_set_email() as $key => $value) {
|
||||
foreach ($value as $k => $v) {
|
||||
wp_mail( $v, $subject, $message );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( cau_get_db_value( 'html_or_text' ) == 'html' ) remove_filter( 'wp_mail_content_type', 'cau_mail_content_type' );
|
||||
|
||||
// Prevent duplicate emails by setting the event again
|
||||
if( $totalNumT > 0 OR $totalNumP > 0 ) {
|
||||
if( $schedule_mail == 'hourly' ) {
|
||||
wp_clear_scheduled_hook('cau_set_schedule_mail');
|
||||
wp_schedule_event( strtotime( '+1 hour', time() ) , 'hourly', 'cau_set_schedule_mail' );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cau_notify_outofdate_db() {
|
||||
|
||||
// Check if cau_get_db_value() function exists.
|
||||
if ( !function_exists( 'cau_get_db_value' ) ) require_once( plugin_dir_path( __FILE__ ) . 'cau_function.php' );
|
||||
|
||||
// Database requires an update
|
||||
if ( cau_incorrectDatabaseVersion() ) {
|
||||
|
||||
// Set up mail
|
||||
$subject = '[' . get_bloginfo( 'name' ) . '] ' . __( 'We need your help with something', 'companion-auto-update' );
|
||||
$message = __( 'Hi there! We need your help updating the database of Companion Auto Update to the latest version. No rush, old features will continue to work but some new features might not work until you update the database.', 'companion-auto-update' );
|
||||
|
||||
// Send to all addresses
|
||||
foreach ( cau_set_email() as $key => $value ) {
|
||||
foreach ( $value as $k => $v ) {
|
||||
wp_mail( $v, $subject, $message );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,420 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Plugin Name: Companion Auto Update
|
||||
* Plugin URI: http://codeermeneer.nl/portfolio/companion-auto-update/
|
||||
* Description: This plugin auto updates all plugins, all themes and the wordpress core.
|
||||
* Version: 3.9.2
|
||||
* Author: Papin Schipper
|
||||
* Author URI: http://codeermeneer.nl/
|
||||
* Contributors: papin
|
||||
* License: GPLv2 or later
|
||||
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||
* Text Domain: companion-auto-update
|
||||
* Domain Path: /languages/
|
||||
*/
|
||||
|
||||
// Disable direct access
|
||||
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
||||
|
||||
// Load translations
|
||||
function cau_init() {
|
||||
load_plugin_textdomain( 'companion-auto-update', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); // Load language files (for backwards compat mostly)
|
||||
add_filter( 'plugins_auto_update_enabled', '__return_false' ); // Turn off default WP5.5 plugin update features to avoid confusion
|
||||
add_filter( 'themes_auto_update_enabled', '__return_false' ); // Turn off default WP5.5 theme update features to avoid confusion
|
||||
}
|
||||
add_action( 'init', 'cau_init' );
|
||||
|
||||
// Set up the database and required schedules
|
||||
function cau_install( $network_wide ) {
|
||||
|
||||
if ( is_multisite() && $network_wide ) {
|
||||
global $wpdb;
|
||||
$blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
|
||||
foreach ( $blog_ids as $blog_id ) {
|
||||
switch_to_blog( $blog_id );
|
||||
cau_database_creation();
|
||||
restore_current_blog();
|
||||
}
|
||||
} else {
|
||||
cau_database_creation();
|
||||
}
|
||||
|
||||
if (! wp_next_scheduled ( 'cau_set_schedule_mail' )) wp_schedule_event( time(), 'daily', 'cau_set_schedule_mail'); // Set schedule for basic notifcations
|
||||
if (! wp_next_scheduled ( 'cau_custom_hooks_plugins' )) wp_schedule_event( time(), 'daily', 'cau_custom_hooks_plugins'); // Run custom hooks on plugin updates
|
||||
if (! wp_next_scheduled ( 'cau_custom_hooks_themes' )) wp_schedule_event( time(), 'daily', 'cau_custom_hooks_themes'); // Run custom hooks on theme updates
|
||||
if (! wp_next_scheduled ( 'cau_log_updater' )) wp_schedule_event( ( time() - 1800 ), 'daily', 'cau_log_updater'); // Keep the log up to date
|
||||
if (! wp_next_scheduled ( 'cau_outdated_notifier' )) wp_schedule_event( time(), 'daily', 'cau_outdated_notifier'); // Set schedule for basic notifcations
|
||||
}
|
||||
|
||||
add_action( 'cau_set_schedule_mail', 'cau_check_updates_mail' );
|
||||
add_action( 'cau_outdated_notifier', 'cau_outdated_notifier_mail' );
|
||||
add_action( 'wp_update_plugins', 'cau_run_custom_hooks_p' );
|
||||
add_action( 'wp_update_themes', 'cau_run_custom_hooks_t' );
|
||||
add_action( 'wp_version_check', 'cau_run_custom_hooks_c' );
|
||||
|
||||
// Hourly event to keep the log up to date
|
||||
function cau_keep_log_uptodate() {
|
||||
cau_savePluginInformation(); // Check for new plugins and themes
|
||||
cau_check_delayed(); // Check for plugin delays
|
||||
}
|
||||
add_action( 'cau_log_updater', 'cau_keep_log_uptodate' );
|
||||
|
||||
// Redirect to welcome screen on activation of plugin
|
||||
function cau_pluginActivateWelcome() {
|
||||
add_option( 'cau_redirectToWelcomeScreen', true );
|
||||
}
|
||||
register_activation_hook(__FILE__, 'cau_pluginActivateWelcome');
|
||||
|
||||
// Redirect to welcome screen on activation of plugin
|
||||
function cau_pluginRedirectWelcomeScreen() {
|
||||
if ( get_option( 'cau_redirectToWelcomeScreen', false ) ) {
|
||||
delete_option( 'cau_redirectToWelcomeScreen' );
|
||||
if( !isset( $_GET['activate-multi'] ) ) {
|
||||
wp_redirect( admin_url( cau_menloc().'?page=cau-settings&welcome=1' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action( 'admin_init', 'cau_pluginRedirectWelcomeScreen' );
|
||||
|
||||
// Donate url
|
||||
function cau_donateUrl() {
|
||||
return 'https://www.paypal.me/dakel/10/';
|
||||
}
|
||||
|
||||
// Database version
|
||||
function cau_db_version() {
|
||||
return '3.8.3';
|
||||
}
|
||||
|
||||
function cau_database_creation() {
|
||||
|
||||
global $wpdb;
|
||||
|
||||
// Plugin db info
|
||||
$cau_db_version = cau_db_version();
|
||||
$autoupdates = $wpdb->prefix."auto_updates";
|
||||
$updateLog = $wpdb->prefix."update_log";
|
||||
|
||||
// WordPress db info
|
||||
$charset_collate = $wpdb->get_charset_collate();
|
||||
|
||||
// DB table creation queries
|
||||
$sql = "CREATE TABLE $autoupdates ( id INT(9) NOT NULL AUTO_INCREMENT, name VARCHAR(255) NOT NULL, onoroff TEXT NOT NULL, UNIQUE KEY id (id) ) $charset_collate;";
|
||||
$sql2 = "CREATE TABLE $updateLog ( id INT(9) NOT NULL AUTO_INCREMENT, slug VARCHAR(255) NOT NULL, oldVersion VARCHAR(10) NOT NULL, newVersion VARCHAR(10) NOT NULL, method VARCHAR(10) NOT NULL, put_on_hold VARCHAR(100) DEFAULT '0', UNIQUE KEY id (id) ) $charset_collate;";
|
||||
|
||||
// Create DB tables
|
||||
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
||||
dbDelta( $sql );
|
||||
dbDelta( $sql2 );
|
||||
|
||||
// Database version
|
||||
add_option( "cau_db_version", "$cau_db_version" );
|
||||
|
||||
// Insert data
|
||||
cau_install_data();
|
||||
}
|
||||
|
||||
// Check if database table exists before creating
|
||||
function cau_check_if_exists( $whattocheck, $id = 'name', $db_table = 'auto_updates' ) {
|
||||
|
||||
global $wpdb;
|
||||
|
||||
$table_name = $wpdb->prefix.$db_table;
|
||||
$rows = $wpdb->get_col( "SELECT COUNT(*) as num_rows FROM {$table_name} WHERE {$id} = '{$whattocheck}'" );
|
||||
$check = $rows[0];
|
||||
|
||||
return ( $check > 0 ) ? true : false;
|
||||
|
||||
}
|
||||
|
||||
// Insert date into database
|
||||
function cau_install_data() {
|
||||
|
||||
global $wpdb;
|
||||
|
||||
$table_name = $wpdb->prefix . "auto_updates";
|
||||
$toemail = get_option('admin_email');
|
||||
|
||||
// Update configs
|
||||
if( !cau_check_if_exists( 'plugins' ) ) $wpdb->insert( $table_name, array( 'name' => 'plugins', 'onoroff' => 'on' ) );
|
||||
if( !cau_check_if_exists( 'themes' ) ) $wpdb->insert( $table_name, array( 'name' => 'themes', 'onoroff' => 'on' ) );
|
||||
if( !cau_check_if_exists( 'minor' ) ) $wpdb->insert( $table_name, array( 'name' => 'minor', 'onoroff' => 'on' ) );
|
||||
if( !cau_check_if_exists( 'major' ) ) $wpdb->insert( $table_name, array( 'name' => 'major', 'onoroff' => '' ) );
|
||||
|
||||
// Email configs
|
||||
if( !cau_check_if_exists( 'email' ) ) $wpdb->insert( $table_name, array( 'name' => 'email', 'onoroff' => '' ) );
|
||||
if( !cau_check_if_exists( 'send' ) ) $wpdb->insert( $table_name, array( 'name' => 'send', 'onoroff' => '' ) );
|
||||
if( !cau_check_if_exists( 'sendupdate' ) ) $wpdb->insert( $table_name, array( 'name' => 'sendupdate', 'onoroff' => '' ) );
|
||||
if( !cau_check_if_exists( 'sendoutdated' ) ) $wpdb->insert( $table_name, array( 'name' => 'sendoutdated', 'onoroff' => '' ) );
|
||||
|
||||
// Advanced
|
||||
if( !cau_check_if_exists( 'notUpdateList' ) ) $wpdb->insert( $table_name, array( 'name' => 'notUpdateList', 'onoroff' => '' ) );
|
||||
if( !cau_check_if_exists( 'translations' ) ) $wpdb->insert( $table_name, array( 'name' => 'translations', 'onoroff' => 'on' ) );
|
||||
if( !cau_check_if_exists( 'wpemails' ) ) $wpdb->insert( $table_name, array( 'name' => 'wpemails', 'onoroff' => 'on' ) );
|
||||
if( !cau_check_if_exists( 'notUpdateListTh' ) ) $wpdb->insert( $table_name, array( 'name' => 'notUpdateListTh', 'onoroff' => '' ) );
|
||||
|
||||
// Stuff
|
||||
if( !cau_check_if_exists( 'html_or_text' ) ) $wpdb->insert( $table_name, array( 'name' => 'html_or_text', 'onoroff' => 'html' ) );
|
||||
if( !cau_check_if_exists( 'dbupdateemails' ) ) $wpdb->insert( $table_name, array( 'name' => 'dbupdateemails', 'onoroff' => '' ) );
|
||||
|
||||
// Advanced
|
||||
if( !cau_check_if_exists( 'allow_administrator' ) ) $wpdb->insert( $table_name, array( 'name' => 'allow_administrator', 'onoroff' => 'on' ) );
|
||||
if( !cau_check_if_exists( 'allow_editor' ) ) $wpdb->insert( $table_name, array( 'name' => 'allow_editor', 'onoroff' => '' ) );
|
||||
if( !cau_check_if_exists( 'allow_author' ) ) $wpdb->insert( $table_name, array( 'name' => 'allow_author', 'onoroff' => '' ) );
|
||||
if( !cau_check_if_exists( 'ignore_seo' ) ) $wpdb->insert( $table_name, array( 'name' => 'ignore_seo', 'onoroff' => '' ) );
|
||||
if( !cau_check_if_exists( 'ignore_cron' ) ) $wpdb->insert( $table_name, array( 'name' => 'ignore_cron', 'onoroff' => '' ) );
|
||||
if( !cau_check_if_exists( 'advanced_info_emails' ) ) $wpdb->insert( $table_name, array( 'name' => 'advanced_info_emails', 'onoroff' => '' ) );
|
||||
if( !cau_check_if_exists( 'update_delay' ) ) $wpdb->insert( $table_name, array( 'name' => 'update_delay', 'onoroff' => '' ) );
|
||||
if( !cau_check_if_exists( 'update_delay_days' ) ) $wpdb->insert( $table_name, array( 'name' => 'update_delay_days', 'onoroff' => '' ) );
|
||||
if( !cau_check_if_exists( 'plugin_links_emails' ) ) $wpdb->insert( $table_name, array( 'name' => 'plugin_links_emails', 'onoroff' => '' ) );
|
||||
|
||||
}
|
||||
register_activation_hook( __FILE__, 'cau_install' );
|
||||
|
||||
// Clear everything on deactivation
|
||||
function cau_remove() {
|
||||
|
||||
// Delete tables
|
||||
global $wpdb;
|
||||
$autoupdates = $wpdb->prefix."auto_updates";
|
||||
$updateLog = $wpdb->prefix."update_log";
|
||||
$wpdb->query( "DROP TABLE IF EXISTS $autoupdates" );
|
||||
$wpdb->query( "DROP TABLE IF EXISTS $updateLog" );
|
||||
|
||||
// Clear schedules
|
||||
wp_clear_scheduled_hook( 'cau_set_schedule_mail' );
|
||||
wp_clear_scheduled_hook( 'cau_custom_hooks_plugins' );
|
||||
wp_clear_scheduled_hook( 'cau_custom_hooks_themes' );
|
||||
wp_clear_scheduled_hook( 'cau_log_updater' );
|
||||
|
||||
// Restore WordPress 5.5 default update functionality
|
||||
add_filter( 'plugins_auto_update_enabled', '__return_true' );
|
||||
add_filter( 'themes_auto_update_enabled', '__return_true' );
|
||||
add_filter( 'auto_plugin_update_send_email', '__return_true' );
|
||||
add_filter( 'auto_theme_update_send_email', '__return_true' );
|
||||
|
||||
}
|
||||
register_deactivation_hook( __FILE__, 'cau_remove' );
|
||||
|
||||
// Update
|
||||
function cau_update_db_check() {
|
||||
|
||||
$cau_db_version = cau_db_version();
|
||||
|
||||
if ( get_site_option( 'cau_db_version' ) != $cau_db_version ) {
|
||||
|
||||
cau_database_creation();
|
||||
|
||||
// In 3.7.2 we've added $wpdb->get_charset_collate
|
||||
if( get_site_option( 'cau_db_version' ) < '3.7.2' ) {
|
||||
|
||||
global $wpdb;
|
||||
$autoupdates = $wpdb->prefix."auto_updates";
|
||||
$updateLog = $wpdb->prefix."update_log";
|
||||
$db_charset = constant( 'DB_CHARSET' );
|
||||
$wpdb->query( "ALTER TABLE $autoupdates CONVERT TO CHARACTER SET $db_charset" );
|
||||
$wpdb->query( "ALTER TABLE $updateLog CONVERT TO CHARACTER SET $db_charset" );
|
||||
}
|
||||
update_option( "cau_db_version", $cau_db_version );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
add_action( 'upgrader_process_complete', 'cau_update_db_check' );
|
||||
|
||||
// Manual update
|
||||
function cau_manual_update() {
|
||||
cau_update_db_check();
|
||||
}
|
||||
|
||||
// Load custom functions
|
||||
require_once( plugin_dir_path( __FILE__ ) . 'cau_functions.php' );
|
||||
|
||||
// Add plugin to menu
|
||||
function register_cau_menu_page() {
|
||||
if( cau_allowed_user_rights() ) add_submenu_page( cau_menloc() , __( 'Auto Updater', 'companion-auto-update' ), __( 'Auto Updater', 'companion-auto-update' ), 'manage_options', 'cau-settings', 'cau_frontend' );
|
||||
}
|
||||
add_action( 'admin_menu', 'register_cau_menu_page' );
|
||||
|
||||
// Settings page
|
||||
function cau_frontend() {
|
||||
|
||||
echo "<div class='wrap cau_content_wrap cau_content'>
|
||||
<h1 class='wp-heading-inline'>".__( 'Companion Auto Update', 'companion-auto-update' )."</h1>
|
||||
<hr class='wp-header-end'>";
|
||||
|
||||
// Make sure the correct timezone is used
|
||||
date_default_timezone_set( cau_get_proper_timezone() );
|
||||
|
||||
// Allow only access to these pages
|
||||
$allowedPages = array(
|
||||
'dashboard' => __( 'Dashboard' ),
|
||||
'pluginlist' => __( 'Update filter', 'companion-auto-update' ),
|
||||
'log' => __( 'Update log', 'companion-auto-update' ),
|
||||
'status' => __( 'Status', 'companion-auto-update' ),
|
||||
);
|
||||
|
||||
// Show subtabs
|
||||
echo "<h2 class='nav-tab-wrapper wp-clearfix'>";
|
||||
|
||||
foreach ( $allowedPages as $page => $title ) {
|
||||
echo "<a href='".cau_url( $page )."' id='tab-".$page."' class='nav-tab "._active_tab( $page )."'>".$title;
|
||||
if( $page == 'status' ) echo cau_pluginHasIssues() ? "<span class='cau_melding level-".cau_pluginIssueLevels()."'></span>" : "<span class='cau_melding level-okay'></span>"; // Show status icon
|
||||
echo "</a>";
|
||||
}
|
||||
|
||||
echo "</h2>";
|
||||
|
||||
// Show page content
|
||||
if( !isset( $_GET['tab'] ) ) {
|
||||
$requestedPage = 'dashboard';
|
||||
echo "<script>jQuery('#tab-dashboard').addClass('nav-tab-active');</script>"; // Set active tab class
|
||||
} else {
|
||||
$requestedPage = sanitize_key( $_GET['tab'] );
|
||||
}
|
||||
|
||||
if( array_key_exists( $requestedPage, $allowedPages ) ) {
|
||||
require_once( plugin_dir_path( __FILE__ ) . 'admin/'.$requestedPage.'.php' );
|
||||
} else {
|
||||
wp_die( 'You\'re not allowed to view <strong>'.$requestedPage.'</strong>.' );
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
|
||||
}
|
||||
|
||||
// Add a widget to the dashboard.
|
||||
function cau_add_widget() {
|
||||
if ( cau_allowed_user_rights() ) wp_add_dashboard_widget( 'cau-update-log', __('Update log', 'companion-auto-update'), 'cau_widget' );
|
||||
}
|
||||
add_action( 'wp_dashboard_setup', 'cau_add_widget' );
|
||||
|
||||
// Widget content
|
||||
function cau_widget() {
|
||||
echo '<style>table.autoupdatewidget { border: 0px solid transparent; border-bottom: 1px solid #EEEEEE; margin: 0 -12px; width: calc(100% + 24px); } table.autoupdatewidget tr td { border-top: 1px solid #EEEEEE; padding: 9px 12px 5px 12px; background: #FAFAFA; } .cau_divide { display: inline-block; color: #E7E0DF; padding: 0 2px; } </style>';
|
||||
echo '<p>'.__('Below are the last 7 updates ran on this site. Includes plugins and themes, both automatically updated and manually updated.', 'companion-auto-update').'</p>';
|
||||
cau_fetch_log( '7' );
|
||||
echo '<p><a href="'.cau_url( 'log' ).'">'.__( 'View full changelog', 'companion-auto-update' ).'</a> <span class="cau_divide">|</span> <a href="'.cau_url( 'dashboard' ).'">'.__( 'Settings' ).'</a></p>';
|
||||
}
|
||||
|
||||
// Load admin styles
|
||||
function load_cau_global_styles( $hook ) {
|
||||
wp_enqueue_style( 'cau_admin_styles', plugins_url( 'backend/style.css' , __FILE__ ) ); // Plugin scripts
|
||||
wp_enqueue_style( 'cau_warning_styles', plugins_url( 'backend/warningbar.css' , __FILE__ ) ); // Check for issues
|
||||
}
|
||||
add_action( 'admin_enqueue_scripts', 'load_cau_global_styles', 99 );
|
||||
|
||||
// Load admin styles
|
||||
function load_cau_page_styles( $hook ) {
|
||||
|
||||
// Only load on plugins' pages
|
||||
if( $hook != 'tools_page_cau-settings' && $hook != 'index_page_cau-settings' ) return;
|
||||
|
||||
// WordPress scripts we need
|
||||
wp_enqueue_style( 'thickbox' );
|
||||
wp_enqueue_script( 'thickbox' );
|
||||
wp_enqueue_script( 'plugin-install' );
|
||||
}
|
||||
add_action( 'admin_enqueue_scripts', 'load_cau_page_styles', 100 );
|
||||
|
||||
// Send e-mails
|
||||
require_once( plugin_dir_path( __FILE__ ) . 'cau_emails.php' );
|
||||
|
||||
// Add settings link on plugin page
|
||||
function cau_settings_link( $links ) {
|
||||
|
||||
$settings_link = '<a href="'.cau_url( 'dashboard' ).'">'.__( 'Settings' ).'</a>';
|
||||
$settings_link2 = '<a href="https://translate.wordpress.org/projects/wp-plugins/companion-auto-update">'.__( 'Help us translate', 'companion-auto-update' ).'</a>';
|
||||
$settings_link3 = '<a href="'.cau_donateUrl().'">'.__( 'Donate to help development', 'companion-auto-update' ).'</a>';
|
||||
|
||||
array_unshift( $links, $settings_link2 );
|
||||
array_unshift( $links, $settings_link3 );
|
||||
if( cau_allowed_user_rights() ) array_unshift( $links, $settings_link );
|
||||
|
||||
return $links;
|
||||
|
||||
}
|
||||
$plugin = plugin_basename(__FILE__);
|
||||
add_filter( "plugin_action_links_$plugin", "cau_settings_link" );
|
||||
|
||||
// Auto Update Class
|
||||
class CAU_auto_update {
|
||||
|
||||
// Enable Update filters
|
||||
public function __construct() {
|
||||
add_action( 'plugins_loaded', array( &$this, 'CAU_auto_update_filters' ), 1 );
|
||||
}
|
||||
|
||||
public function CAU_auto_update_filters() {
|
||||
|
||||
global $wpdb;
|
||||
$table_name = $wpdb->prefix . "auto_updates";
|
||||
|
||||
// Disable WP emails
|
||||
add_filter( 'auto_plugin_update_send_email', '__return_false' ); // Plugin updates
|
||||
add_filter( 'auto_theme_update_send_email', '__return_false' ); // Theme updates
|
||||
|
||||
// Enable for major updates
|
||||
$configs = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE name = 'major'");
|
||||
foreach ( $configs as $config ) {
|
||||
if( $config->onoroff == 'on' ) add_filter( 'allow_major_auto_core_updates', '__return_true', 1 ); // Turn on
|
||||
else add_filter( 'allow_major_auto_core_updates', '__return_false', 1 ); // Turn off
|
||||
}
|
||||
|
||||
// Enable for minor updates
|
||||
$configs = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE name = 'minor'");
|
||||
foreach ( $configs as $config ) {
|
||||
if( $config->onoroff == 'on' ) add_filter( 'allow_minor_auto_core_updates', '__return_true', 1 ); // Turn on
|
||||
else add_filter( 'allow_minor_auto_core_updates', '__return_false', 1 ); // Turn off
|
||||
}
|
||||
|
||||
// Enable for plugins
|
||||
$configs = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE name = 'plugins'");
|
||||
foreach ( $configs as $config ) {
|
||||
if( $config->onoroff == 'on' ) add_filter( 'auto_update_plugin', 'cau_dontUpdatePlugins', 10, 2 ); // Turn on
|
||||
else add_filter( 'auto_update_plugin', '__return_false', 1 ); // Turn off
|
||||
}
|
||||
|
||||
// Enable for themes
|
||||
$configs = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE name = 'themes'");
|
||||
foreach ( $configs as $config ) {
|
||||
if( $config->onoroff == 'on' ) add_filter( 'auto_update_theme', '__return_true' ); // Turn on
|
||||
else add_filter( 'auto_update_theme', '__return_false', 1 ); // Turn off
|
||||
}
|
||||
|
||||
// Enable for translation files
|
||||
$configs = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE name = 'translations'");
|
||||
foreach ( $configs as $config ) {
|
||||
if( $config->onoroff == 'on' ) add_filter( 'auto_update_translation', '__return_true', 1 ); // Turn on
|
||||
else add_filter( 'auto_update_translation', '__return_false', 1 ); // Turn off
|
||||
}
|
||||
|
||||
// WP Email Config
|
||||
$configs = $wpdb->get_results( "SELECT * FROM {$table_name} WHERE name = 'wpemails'");
|
||||
foreach ( $configs as $config ) {
|
||||
if( $config->onoroff == 'on' ) add_filter( 'auto_core_update_send_email', '__return_true', 1 ); // Turn on
|
||||
else add_filter( 'auto_core_update_send_email', '__return_false', 1 ); // Turn off
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
new CAU_auto_update();
|
||||
|
||||
// Check for issues
|
||||
function cau_checkForIssues( $admin_bar ) {
|
||||
if( cau_pluginHasIssues() && is_admin() && cau_pluginIssueLevels() == 'high' ) {
|
||||
$admin_bar->add_menu( array(
|
||||
'id' => 'cau-has-issues',
|
||||
'title' => '<span class="ab-icon"></span><span class="cau-level-'.cau_pluginIssueLevels().'">'.cau_pluginIssueCount().'</span>',
|
||||
'href' => cau_url( 'status' ),
|
||||
'meta' => array(
|
||||
'target' => '_self',
|
||||
'title' => __( 'Companion Auto Update ran into a critical error. View the status log for more info.', 'companion-auto-update' ),
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
add_action( 'admin_bar_menu', 'cau_checkForIssues', 150 );
|
@ -1,2 +0,0 @@
|
||||
<?php
|
||||
# Silence is golden.
|
@ -1,62 +0,0 @@
|
||||
# Copyright (C) 2016 Companion Auto Update
|
||||
# This file is distributed under the same license as the Companion Auto Update package.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Companion Auto Update 1.0\n"
|
||||
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/companion-auto-"
|
||||
"update\n"
|
||||
"POT-Creation-Date: 2016-05-24 08:16:37+00:00\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
||||
#: companion_portfolio.php:96
|
||||
msgid "Auto Updater"
|
||||
msgstr ""
|
||||
|
||||
#: companion_portfolio.php:122
|
||||
msgid "Auto update plugins?"
|
||||
msgstr ""
|
||||
|
||||
#: companion_portfolio.php:122
|
||||
msgid "Auto update themes?"
|
||||
msgstr ""
|
||||
|
||||
#: companion_portfolio.php:122
|
||||
msgid "Auto update minor core updates?"
|
||||
msgstr ""
|
||||
|
||||
#: companion_portfolio.php:122
|
||||
msgid "Auto update major core updates?"
|
||||
msgstr ""
|
||||
|
||||
#: companion_portfolio.php:125
|
||||
msgid "Settings saved"
|
||||
msgstr ""
|
||||
|
||||
#: companion_portfolio.php:125
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#. Plugin Name of the plugin/theme
|
||||
msgid "Companion Auto Update"
|
||||
msgstr ""
|
||||
|
||||
#. #-#-#-#-# plugin.pot (Companion Auto Update 1.0) #-#-#-#-#
|
||||
#. Plugin URI of the plugin/theme
|
||||
#. #-#-#-#-# plugin.pot (Companion Auto Update 1.0) #-#-#-#-#
|
||||
#. Author URI of the plugin/theme
|
||||
msgid "https://qreative-web.com"
|
||||
msgstr ""
|
||||
|
||||
#. Description of the plugin/theme
|
||||
msgid ""
|
||||
"This plugin auto updates all plugins, all themes and the wordpress core."
|
||||
msgstr ""
|
||||
|
||||
#. Author of the plugin/theme
|
||||
msgid "Qreative-Web"
|
||||
msgstr ""
|
@ -1,4 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
@ -1,206 +0,0 @@
|
||||
=== Companion Auto Update ===
|
||||
Contributors: Papin, qweb
|
||||
Donate link: https://www.paypal.me/dakel/10/
|
||||
Tags: auto, automatic, background, update, updates, updating, automatic updates, automatic background updates, easy update, wordpress update, theme update, plugin update, up-to-date, security, update latest version, update core, update wp, update wp core, major updates, minor updates, update to new version, update core, update plugin, update plugins, update plugins automatically, update theme, plugin, theme, advance, control, mail, notifations, enable
|
||||
Requires at least: 5.3.0
|
||||
Tested up to: 6.5
|
||||
Requires PHP: 5.1
|
||||
Stable tag: 3.9.2
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Manage all updates on your WordPress site. Stay in the know with several optional e-mail notifications and logs. For free.
|
||||
|
||||
== Description ==
|
||||
|
||||
Companion Auto Update is a powerful and completely free plugin that allows you to manage all the updates on your WordPress site. Our aim is to give you the best control over these updates and stay in the know at all times.
|
||||
|
||||
We understand that you might not always be able to check if your WordPress site has any updates that need to be installed. Especially when you maintain multiple websites keeping them up-to-date can be a lot of work. This plugin can help you with that. We'll keep your site up-to-date and keep you posted about what's happening and notify you when we need your help with something.
|
||||
|
||||
If you have a feature suggestion or idea you’d like to see in the plugin, we’d love to hear about it! [Suggest a Feature](https://codeermeneer.nl/contact/)
|
||||
|
||||
= Main features =
|
||||
1. Auto-updating for plugins, themes, core and translation files
|
||||
1. Set at what time you wish to update
|
||||
1. Filter plugins and themes to not be updated
|
||||
1. E-mail notifications about old software, pending updates and completed updates
|
||||
1. An update log with all updates
|
||||
1. Option to delay automatic updates with an x number of days
|
||||
|
||||
= Full control over everything =
|
||||
Full control, that's what this plugin is all about. With this plugin you can enable (or disable) automatic updating for plugins, themes, WordPress core updates (both minor and major can be changed separately) and for translation files. Don't want to run the updater for all plugins? Don't worry, just disable auto updating for the plugins you'd like to skip and we can even notify you when there's an update for these plugins so you can go and update them yourself.
|
||||
|
||||
= Scheduling =
|
||||
By default we'll check for updates twice a day but you can change this to several different options if you'd like. When choosing to update on a daily basis you can even select at what time you'd like it to run. Besides the updaters you can also schedule te notifications, want to update every hour but only recieve notifications once a day? No problem!
|
||||
Sometimes developers will push an update that will cause errors on your site, they'll often fix it within a day but if the updater has run in the mean time it can cause all kinds of issues. Now you can choose to delay updates with an x number of days to prevent this from happening.
|
||||
|
||||
= Know what's happening =
|
||||
We want you to know what's happening on your website. This plugin offers settings for various email notifications. We can send you an email when an update is available, when a plugin has been updated or when wordpress has been updated.
|
||||
But if you don't want to recieve emails about this you can still log in and view the changelog to see what happened.
|
||||
|
||||
== Installation ==
|
||||
|
||||
How to install Companion Auto Update
|
||||
|
||||
= Manual install =
|
||||
1. Download Companion Auto Update.
|
||||
1. Upload the 'Companion Auto Update' directory to your '/wp-content/plugins/' directory.
|
||||
1. Activate Companion Auto Update from your Plugins page.
|
||||
|
||||
= Via WordPress =
|
||||
1. Search for 'Companion Auto Update'.
|
||||
1. Click install.
|
||||
1. Activate.
|
||||
|
||||
= Settings =
|
||||
Settings can be found trough Tools > Auto Updater
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
|
||||
= Check our website for the FAQ =
|
||||
|
||||
[https://codeermeneer.nl/documentation/auto-update/faq-auto-updater/](https://codeermeneer.nl/documentation/auto-update/faq-auto-updater/)
|
||||
|
||||
= What features can I expect to see in the future? =
|
||||
|
||||
Your feedback is what made this plugin what is and what it’ll become so keep the feedback coming! To see what features you've suggested and what we're working on [read our blogpost here](https://codeermeneer.nl/blog/companion-auto-update-and-its-future/)
|
||||
|
||||
= What's the difference between WordPress 5.5 and this plugin? =
|
||||
|
||||
WordPress 5.5 was released recently and it packs tons of new features. One of those features is auto-updates for plugins and themes. Something Companion Auto Update does too.
|
||||
So obviously, some of you wondered what the difference would be between the default WordPress method and the one offered by Companion Auto Update and I figured I’d quickly write a blog about it, explaining the differences.
|
||||
|
||||
[You can read this blogpost here](https://codeermeneer.nl/blog/wordpress-5-5-versus-companion-auto-update/)
|
||||
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
1. Full control over what to update and when to recieve notifications
|
||||
2. Disable auto-updating for certain plugins and/or themes
|
||||
3. Advanced scheduling options for updating and notifcations
|
||||
4. Keep track of updates with the update log
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 3.9.2 (June 11, 2024) =
|
||||
* Fixed some more undefined variables
|
||||
* Declared support for WP6.5
|
||||
|
||||
= 3.9.1 (March 8, 2024) =
|
||||
* Fixed: Undefined variable $totalNum
|
||||
|
||||
= 3.9.0 (February 2, 2024) =
|
||||
* Fixed: Fatal error during Cron
|
||||
* Fixed: PHP deprecated error for PHP 8 and up
|
||||
|
||||
= 3.8.9 (January 9, 2024) =
|
||||
* Fixed error: Call to undefined function is_plugin_active()
|
||||
|
||||
= 3.8.8 (December 19, 2023) =
|
||||
* Fixed a few minor bugs
|
||||
* Made some performance improvements
|
||||
* We now require at least WordPress 5.3
|
||||
|
||||
= 3.8.7.1 (September 28, 2022) =
|
||||
* Tweak: Extended function_exists check with get_plugins() for the fatal error when trying to send update emails
|
||||
|
||||
= 3.8.7 (September 12, 2022) =
|
||||
* Fix: Fatal error when trying to send update emails
|
||||
|
||||
= 3.8.6 (August 11, 2022) =
|
||||
* Tweak: Code optimization for better performance
|
||||
|
||||
= 3.8.5 (March 17, 2022) =
|
||||
* New: Added more checks on the status page and added an explanation to some of them.
|
||||
* New: Added an list of delayed updates on the status page to help with troubleshooting.
|
||||
* Tweak: Made some improvements to the update delay feature.
|
||||
* Tweak: Added a notice to explain that update delay does not work with WordPress update currently.
|
||||
* Tweak: Improved code on the status page to be more reliable.
|
||||
|
||||
= 3.8.4 (February 2, 2022) =
|
||||
* Tweak: Fixed a few styling errors with WP5.9
|
||||
|
||||
= 3.8.3 (December 9, 2021) =
|
||||
* New: Plugin update e-mails now have an option to link to a few important pages
|
||||
* Fix: Error: Undefined index: dbupdateemails
|
||||
* Fix: Error: A non-numeric value encountered
|
||||
|
||||
= 3.8.2 (July 1, 2021) =
|
||||
* Fix: Error: Call to undefined function get_plugin_updates()
|
||||
|
||||
= 3.8.1 (June 4, 2021) =
|
||||
* New: Be notified when we need your help updating to a new database version [Feature Request](https://wordpress.org/support/topic/feature-request-839/)
|
||||
* Tweak: Made some under the hood performance improvements
|
||||
|
||||
= 3.8.0 (January 14, 2021) =
|
||||
* New: Better handling of plugins with an unknown WP version
|
||||
* New: More intervals for notifications
|
||||
* Fix: Call to undefined function errors
|
||||
|
||||
= 3.7.1.1 (November 2, 2020) =
|
||||
* Fix: Type in wp_next_scheduled
|
||||
|
||||
= 3.7.1 (October 30, 2020) =
|
||||
* Fix: PHP Warning: strtotime() expects parameter 2 to be integer, string given
|
||||
|
||||
= 3.7 (September 8, 2020) =
|
||||
* New: Delay updates with an x number of days
|
||||
* New: Be notified of plugins that have not been tested with the latest 3 major releases of WordPress.
|
||||
* New: Choose to see more info in the emails (like the time at which the update happened)
|
||||
* Fix: "Contact for support" button will work again
|
||||
* Fix: Fixed a few PHP errors
|
||||
* Tweak: Made improvements to the "Fix it" button for the "All automatic updates are disabled" error.
|
||||
* Tweak: You can now choose to ignore the "Search Engine Visibility" and "Cronjobs" warnings
|
||||
* Tweak: Reports on the Site Health page will only show a summary and point to the status page for more information and possible fixes
|
||||
* Tweak: Removed cronjob check and Search Engine Visibility check from site health
|
||||
* Tweak: E-mails are now fully translatable
|
||||
* Tweak: Renamed Core notifications to WordPress notifications
|
||||
* Tweak: WordPress plugin and theme update notifications are now disabled
|
||||
|
||||
Also: Check out what features we're working on at [our blogpost](https://codeermeneer.nl/blog/companion-auto-update-and-its-future/)
|
||||
|
||||
= 3.6 (August 12, 2020) =
|
||||
* New: Added an "after core update" hook [More info](https://codeermeneer.nl/documentation/codex-auto-updater/)
|
||||
* New: Select which userroles can access settings. (Defaults to only administrators)
|
||||
* Tweak: Added Theme and Core update method the log
|
||||
* Tweak: Few WordPress 5.5 improvements
|
||||
|
||||
= 3.5.5 (August 5, 2020) =
|
||||
* Fix: Added better multisite support
|
||||
* Tweak: We've added a bunch more checks to the status page and you can now see more passed checks.
|
||||
* Support for WordPress 5.5
|
||||
|
||||
= 3.5.4.1 (June 20, 2020) =
|
||||
* Fix: Sometimes the hour settings for intervals wouldn't show up
|
||||
|
||||
= 3.5.4 (June 19, 2020) =
|
||||
* New: See translations in the update log
|
||||
* New: We've added a few checks to WordPress' Site Health page
|
||||
* Fix: Error with Companion Auto Update Database Update
|
||||
* Fix: Schedule interval duplicates
|
||||
|
||||
= 3.5.3 (June 5, 2020) =
|
||||
* New: We're working on a better update log. You should see the Update method (Manual/Automatic) in the log now. (Only works for Plugins right now)
|
||||
Please report any issues with this feature over at our sticky post: [Problems with the Update method in the new update log?](https://wordpress.org/support/topic/problems-with-the-update-method-in-the-new-update-log/)
|
||||
* Fix: Not able to see checks in boxes (reverted back to before it all went wrong)
|
||||
* Fix: Error date_default_timezone_set(): Timezone ID +00:00 is invalid
|
||||
* Tweak: The status tab will no longer show turned-off settings as an error
|
||||
* Tweak: Made some improvements to the "Update pending" emails, you can now see a list of all pending updates and go directly to the update page.
|
||||
|
||||
= 3.5.2 (April 1, 2020) =
|
||||
* Fix: Not able to see checks in boxes
|
||||
|
||||
= 3.5.1 (March 25, 2020) =
|
||||
* Tweak: You seem to like the new dashboard, we've fixed a few issues regarding the responsiveness of the design. We've also tweaked the icons to be a bit more transparant.
|
||||
* Tweak: We've added the release notes link to Plain text emails
|
||||
* Tweak: Fixed a few typos
|
||||
* Tweak: Various minor security improvements
|
||||
|
||||
= 3.5.0 (March 5, 2020) =
|
||||
* New: In version 3.4.6 we've changed to HTML emails rather than plain text, in this version you can opt to change it back to plain text emails
|
||||
* Fix: We've 'fixed an issue where on occasion nothing would update
|
||||
* Tweak: Made some improvements to the "Fix it" button for the AUTOMATIC_UPDATER_DISABLED error
|
||||
* Tweak: We've changed the dashboard, moved both the settings page and de support page to the dashboard. Please let us know if you like this change or not.
|
||||
* Bug: We've had to (temporarily) disable the theme filter because it was causing issues on some installations. We'll try to get it working again in a future update.
|
||||
|
||||
[View full changelog](https://codeermeneer.nl/stuffs/auto-updater-changelog/)
|
@ -1,46 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying 404 pages (Not Found).
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
get_header(); ?>
|
||||
|
||||
<div <?php generate_do_attr( 'content' ); ?>>
|
||||
<main <?php generate_do_attr( 'main' ); ?>>
|
||||
<?php
|
||||
/**
|
||||
* generate_before_main_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
do_action( 'generate_before_main_content' );
|
||||
|
||||
generate_do_template_part( '404' );
|
||||
|
||||
/**
|
||||
* generate_after_main_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
do_action( 'generate_after_main_content' );
|
||||
?>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* generate_after_primary_content_area hook.
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
do_action( 'generate_after_primary_content_area' );
|
||||
|
||||
generate_construct_sidebars();
|
||||
|
||||
get_footer();
|
@ -1,85 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying Archive pages.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
get_header(); ?>
|
||||
|
||||
<div <?php generate_do_attr( 'content' ); ?>>
|
||||
<main <?php generate_do_attr( 'main' ); ?>>
|
||||
<?php
|
||||
/**
|
||||
* generate_before_main_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
do_action( 'generate_before_main_content' );
|
||||
|
||||
if ( generate_has_default_loop() ) {
|
||||
if ( have_posts() ) :
|
||||
|
||||
/**
|
||||
* generate_archive_title hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_archive_title - 10
|
||||
*/
|
||||
do_action( 'generate_archive_title' );
|
||||
|
||||
/**
|
||||
* generate_before_loop hook.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*/
|
||||
do_action( 'generate_before_loop', 'archive' );
|
||||
|
||||
while ( have_posts() ) :
|
||||
|
||||
the_post();
|
||||
|
||||
generate_do_template_part( 'archive' );
|
||||
|
||||
endwhile;
|
||||
|
||||
/**
|
||||
* generate_after_loop hook.
|
||||
*
|
||||
* @since 2.3
|
||||
*/
|
||||
do_action( 'generate_after_loop', 'archive' );
|
||||
|
||||
else :
|
||||
|
||||
generate_do_template_part( 'none' );
|
||||
|
||||
endif;
|
||||
}
|
||||
|
||||
/**
|
||||
* generate_after_main_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
do_action( 'generate_after_main_content' );
|
||||
?>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* generate_after_primary_content_area hook.
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
do_action( 'generate_after_primary_content_area' );
|
||||
|
||||
generate_construct_sidebars();
|
||||
|
||||
get_footer();
|
@ -1,153 +0,0 @@
|
||||
.block-editor-block-list__layout pre {
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
line-height: normal;
|
||||
margin-bottom: 1.5em;
|
||||
padding: 20px;
|
||||
overflow: auto;
|
||||
color: inherit; /* editor only */
|
||||
}
|
||||
|
||||
body .block-editor-block-list__block blockquote {
|
||||
border-left: 5px solid rgba(0, 0, 0, 0.05);
|
||||
padding: 20px;
|
||||
font-size: 1.2em;
|
||||
font-style:italic;
|
||||
margin: 0 0 1.5em;
|
||||
position: relative;
|
||||
color: inherit; /* editor only */
|
||||
}
|
||||
|
||||
body .wp-block-quote:not(.is-large):not(.is-style-large) {
|
||||
border-left: 5px solid rgba(0, 0, 0, 0.05);
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
body .block-editor-block-list__block blockquote p:last-child {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.block-editor-block-list__layout table,
|
||||
.block-editor-block-list__layout th,
|
||||
.block-editor-block-list__layout td {
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
body .block-editor-block-list__block table {
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
border-width: 1px 0 0 1px;
|
||||
margin: 0 0 1.5em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.block-editor-block-list__layout th,
|
||||
.block-editor-block-list__layout td {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.block-editor-block-list__layout th {
|
||||
border-width: 0 1px 1px 0;
|
||||
}
|
||||
|
||||
.block-editor-block-list__layout td {
|
||||
border-width: 0 1px 1px 0;
|
||||
}
|
||||
|
||||
body .block-editor-block-list__block hr {
|
||||
background-color: rgba(0, 0, 0, 0.1);
|
||||
border: 0;
|
||||
height: 1px;
|
||||
margin-bottom: 40px;
|
||||
margin-top: 40px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
body .block-editor-default-block-appender input[type=text].editor-default-block-appender__content,
|
||||
body .block-editor-default-block-appender textarea.editor-default-block-appender__content {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
## Gallery
|
||||
--------------------------------------------------------------*/
|
||||
|
||||
.block-editor-block-list__layout .wp-block-gallery li figcaption {
|
||||
background: rgba(255, 255, 255, 0.7);
|
||||
color: #000;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Button
|
||||
--------------------------------------------------------------*/
|
||||
|
||||
.block-editor-block-list__layout .wp-block-button .wp-block-button__link,
|
||||
.block-editor-block-list__layout .button {
|
||||
font-size: inherit;
|
||||
padding: 10px 15px;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Content Title
|
||||
--------------------------------------------------------------*/
|
||||
|
||||
button.content-title-visibility {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
font-size: 30px;
|
||||
line-height: 30px;
|
||||
top: calc(50% - 15px);
|
||||
opacity: 0.4;
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
}
|
||||
|
||||
button.show-content-title:before {
|
||||
content: "\f530";
|
||||
}
|
||||
|
||||
button.disable-content-title:before {
|
||||
content: "\f177";
|
||||
}
|
||||
|
||||
body:not(.content-title-hidden) .editor-post-title__block:hover button.disable-content-title,
|
||||
.content-title-hidden .editor-post-title__block:hover button.show-content-title {
|
||||
display: block;
|
||||
}
|
||||
|
||||
button.content-title-visibility:before {
|
||||
font-family: dashicons;
|
||||
}
|
||||
|
||||
.content-title-hidden .editor-post-title textarea {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.edit-post-text-editor .editor-post-title__block .editor-post-title__input {
|
||||
color: initial;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Columns
|
||||
--------------------------------------------------------------*/
|
||||
|
||||
.block-editor-block-list__block .wp-block-columns .wp-block-column {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Fix shortcode block label color
|
||||
--------------------------------------------------------------*/
|
||||
|
||||
.wp-block-shortcode label,
|
||||
.wp-block-shortcode .block-editor-plain-text {
|
||||
color: initial;
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
pre {
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
line-height: normal;
|
||||
margin-bottom: 1.5em;
|
||||
padding: 20px;
|
||||
overflow: auto;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
border-left: 5px solid rgba(0, 0, 0, 0.05);
|
||||
padding: 20px;
|
||||
font-size: 1.2em;
|
||||
font-style:italic;
|
||||
margin: 0 0 1.5em;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
blockquote p:last-child {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
table, th, td {
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
table {
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
border-width: 1px 0 0 1px;
|
||||
margin: 0 0 1.5em;
|
||||
table-layout: fixed;
|
||||
width: 100%;
|
||||
}
|
||||
th,
|
||||
td {
|
||||
padding: 8px;
|
||||
}
|
||||
th {
|
||||
border-width: 0 1px 1px 0;
|
||||
}
|
||||
td {
|
||||
border-width: 0 1px 1px 0;
|
||||
}
|
||||
|
||||
hr {
|
||||
background-color: rgba(0, 0, 0, 0.1);
|
||||
border: 0;
|
||||
height: 1px;
|
||||
margin-bottom: 40px;
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
/* Make sure embeds and iframes fit their containers */
|
||||
embed,
|
||||
iframe,
|
||||
object {
|
||||
max-width: 100%;
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
body {
|
||||
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||
font-weight: normal;
|
||||
text-transform: none;
|
||||
font-size: 17px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
p {
|
||||
line-height: inherit;
|
||||
font-size: inherit;
|
||||
margin-top: 0;
|
||||
margin-bottom: 1.5em;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-family: inherit;
|
||||
font-size: 100%;
|
||||
font-style: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-family: inherit;
|
||||
font-size: 42px;
|
||||
margin-bottom: 20px;
|
||||
margin-top: 0;
|
||||
line-height: 1.2em;
|
||||
font-weight: normal;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-family: inherit;
|
||||
font-size: 35px;
|
||||
margin-bottom: 20px;
|
||||
margin-top: 0;
|
||||
line-height: 1.2em;
|
||||
font-weight: normal;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-family: inherit;
|
||||
font-size: 29px;
|
||||
margin-bottom: 20px;
|
||||
margin-top: 0;
|
||||
line-height: 1.2em;
|
||||
font-weight: normal;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-family: inherit;
|
||||
margin-bottom: 20px;
|
||||
margin-top: 0;
|
||||
}
|
@ -1,98 +0,0 @@
|
||||
.generate-meta-box-content > div {
|
||||
padding: 12px;
|
||||
}
|
||||
#generate_layout_options_meta_box .inside {
|
||||
padding: 0;
|
||||
margin:0;
|
||||
}
|
||||
#generate-meta-box-container .generate-meta-box-menu {
|
||||
position: relative;
|
||||
float: left;
|
||||
list-style: none;
|
||||
width: 180px;
|
||||
line-height: 1em;
|
||||
margin: 0 0 -1px 0;
|
||||
padding: 0;
|
||||
background-color: #fafafa;
|
||||
border-right: 1px solid #eee;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#generate-meta-box-container .generate-meta-box-menu li {
|
||||
display: block;
|
||||
position: relative;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
#generate-meta-box-container .generate-meta-box-menu li a {
|
||||
display: block;
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
line-height: 20px !important;
|
||||
text-decoration: none;
|
||||
border-bottom: 1px solid #eee;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
#generate-meta-box-container .generate-meta-box-content {
|
||||
float: left;
|
||||
width: calc( 100% - 180px );
|
||||
margin-left: -1px;
|
||||
border-left: 1px solid #eee;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
#generate-meta-box-container {
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
background: linear-gradient( 90deg, #fafafa 0%, #fafafa 180px, #fff 180px, #fff 100% );
|
||||
}
|
||||
|
||||
#generate-meta-box-container .current {
|
||||
position: relative;
|
||||
font-weight: bold;
|
||||
background-color: #e0e0e0;
|
||||
}
|
||||
|
||||
#generate-meta-box-container .current a {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
#generate-meta-box-container label {
|
||||
font-weight: 400;
|
||||
display: inline-block;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
|
||||
.generate-meta-box-menu li {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#side-sortables #generate-meta-box-container .generate-meta-box-menu,
|
||||
#side-sortables #generate-meta-box-container .generate-meta-box-content {
|
||||
float: none;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.edit-post-meta-boxes-area.is-side .generate-meta-box-content > div {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.edit-post-meta-boxes-area.is-side .generate-meta-box-menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#generate-meta-box-container label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.edit-post-meta-boxes-area.is-side #generate-meta-box-container label.generate-layout-metabox-section-title {
|
||||
display: block;
|
||||
font-weight: 500;
|
||||
margin-bottom: 5px;
|
||||
}
|
@ -1,232 +0,0 @@
|
||||
.js .generate-metabox.postbox .hndle {
|
||||
cursor: inherit;
|
||||
}
|
||||
|
||||
.generate-metabox .clear {
|
||||
padding-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
border-bottom: 1px solid #DDD;
|
||||
}
|
||||
|
||||
.generate-metabox .clear:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.customize-button a.button,
|
||||
.customize-button a.button:visited {
|
||||
font-size: 25px;
|
||||
padding: 10px 20px;
|
||||
line-height: normal;
|
||||
height: auto;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.customize-button {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.addon-container:before,
|
||||
.addon-container:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
visibility: hidden;
|
||||
font-size: 0;
|
||||
line-height: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
.addon-container:after {
|
||||
clear: both;
|
||||
}
|
||||
.premium-addons .gp-clear {
|
||||
margin: 0 !important;
|
||||
border: 0;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.premium-addons .add-on.gp-clear {
|
||||
padding: 15px !important;
|
||||
margin: 0 !important;
|
||||
-moz-box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1) inset;
|
||||
-webkit-box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1) inset;
|
||||
box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1) inset;
|
||||
}
|
||||
.premium-addons .add-on:last-child {
|
||||
border: 0 !important;
|
||||
}
|
||||
.addon-action {
|
||||
float: right;
|
||||
clear: right;
|
||||
}
|
||||
.addon-name {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.addon-name a {
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* New admin */
|
||||
.clearfix:after,
|
||||
.clearfix:before {
|
||||
content: ".";
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
visibility: hidden;
|
||||
font-size: 0;
|
||||
line-height: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.clearfix:after {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.gp-container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 0 20px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.gp-container a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.appearance_page_generate-options #wpcontent,
|
||||
.appearance_page_generate-options #wpbody-content .metabox-holder {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.appearance_page_generate-options .wrap {
|
||||
margin-top: 0;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.gp-masthead {
|
||||
background-color: #fff;
|
||||
text-align: center;
|
||||
box-shadow: 0 1px 0 rgba(200,215,225,0.5), 0 1px 2px #DDD;
|
||||
margin-bottom: 40px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.gp-container .postbox {
|
||||
box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #DDD;
|
||||
border: 0;
|
||||
min-width: initial;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.gp-masthead .gp-title {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.gp-masthead .gp-title a {
|
||||
font-size: 20px;
|
||||
color: #000;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.gp-masthead .gp-masthead-links {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.gp-masthead-links a {
|
||||
display: inline-block;
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.gp-masthead .gp-version {
|
||||
display: inline-block;
|
||||
background: #EFEFEF;
|
||||
padding: 1px 3px;
|
||||
border-radius: 2px;
|
||||
font-size: 11px;
|
||||
vertical-align: top;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.gp-options-footer {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.popular-articles ul {
|
||||
list-style-type: disc;
|
||||
margin-left: 20px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.popular-articles .hndle a {
|
||||
float:right;
|
||||
font-size:13px;
|
||||
}
|
||||
|
||||
#gen-delete p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.start-customizing li {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.start-customizing li span {
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.start-customizing ul {
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.gp-container .postbox > h3.hndle {
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.hide-on-desktop {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.grid-70 {
|
||||
float: left;
|
||||
width: 70%;
|
||||
box-sizing: border-box;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.grid-30 {
|
||||
float: left;
|
||||
width: 30%;
|
||||
box-sizing: border-box;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.grid-parent {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.hide-on-mobile {
|
||||
display: none;
|
||||
}
|
||||
.gp-masthead .gp-masthead-links,
|
||||
.gp-masthead .gp-title {
|
||||
float: none;
|
||||
text-align: center;
|
||||
}
|
||||
.gp-masthead .gp-title {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
@ -1,129 +0,0 @@
|
||||
.comment-content a {
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.bypostauthor {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.comment,
|
||||
.comment-list {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.comment-author-info {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.comment-meta .avatar {
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.comment-author cite {
|
||||
font-style: normal;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.entry-meta.comment-metadata {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.comment-content {
|
||||
margin-top: 1.5em;
|
||||
}
|
||||
|
||||
.comment-respond {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.comment-form > .form-submit {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.comment-form input,
|
||||
.comment-form-comment {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.comment-form-comment textarea {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
.comment-form #author,
|
||||
.comment-form #email,
|
||||
.comment-form #url {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.comment-metadata .edit-link:before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.comment-body {
|
||||
padding: 30px 0;
|
||||
}
|
||||
|
||||
.comment-content {
|
||||
padding: 30px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.depth-1.parent > .children {
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.comment .children {
|
||||
padding-left: 30px;
|
||||
margin-top: -30px;
|
||||
border-left: 1px solid rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.pingback .comment-body,
|
||||
.trackback .comment-body {
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.pingback .edit-link {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.comment-content p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.comment-list > .comment:first-child {
|
||||
padding-top: 0;
|
||||
margin-top: 0;
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
ol.comment-list {
|
||||
margin-bottom: 1.5em;
|
||||
}
|
||||
|
||||
.comment-form-cookies-consent {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.comment-form-cookies-consent input {
|
||||
margin-right: 0.5em;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.one-container .comments-area {
|
||||
margin-top: 1.5em;
|
||||
}
|
||||
|
||||
.comment-content .reply {
|
||||
font-size: 85%;
|
||||
}
|
||||
|
||||
#cancel-comment-reply-link {
|
||||
padding-left: 10px;
|
||||
}
|
@ -1 +0,0 @@
|
||||
.comment-content a{word-wrap:break-word}.bypostauthor{display:block}.comment,.comment-list{list-style-type:none;padding:0;margin:0}.comment-author-info{display:inline-block;vertical-align:middle}.comment-meta .avatar{float:left;margin-right:10px;border-radius:50%}.comment-author cite{font-style:normal;font-weight:700}.entry-meta.comment-metadata{margin-top:0}.comment-content{margin-top:1.5em}.comment-respond{margin-top:0}.comment-form>.form-submit{margin-bottom:0}.comment-form input,.comment-form-comment{margin-bottom:10px}.comment-form-comment textarea{resize:vertical}.comment-form #author,.comment-form #email,.comment-form #url{display:block}.comment-metadata .edit-link:before{display:none}.comment-body{padding:30px 0}.comment-content{padding:30px;border:1px solid rgba(0,0,0,.05)}.depth-1.parent>.children{border-bottom:1px solid rgba(0,0,0,.05)}.comment .children{padding-left:30px;margin-top:-30px;border-left:1px solid rgba(0,0,0,.05)}.pingback .comment-body,.trackback .comment-body{border-bottom:1px solid rgba(0,0,0,.05)}.pingback .edit-link{font-size:13px}.comment-content p:last-child{margin-bottom:0}.comment-list>.comment:first-child{padding-top:0;margin-top:0;border-top:0}ol.comment-list{margin-bottom:1.5em}.comment-form-cookies-consent{display:flex;align-items:center}.comment-form-cookies-consent input{margin-right:.5em;margin-bottom:0}.one-container .comments-area{margin-top:1.5em}.comment-content .reply{font-size:85%}#cancel-comment-reply-link{padding-left:10px}
|
@ -1,174 +0,0 @@
|
||||
@font-face {
|
||||
font-family: "GeneratePress";
|
||||
src: url("../../fonts/generatepress.eot");
|
||||
src: url("../../fonts/generatepress.eot#iefix") format("embedded-opentype"), url("../../fonts/generatepress.woff2") format("woff2"), url("../../fonts/generatepress.woff") format("woff"), url("../../fonts/generatepress.ttf") format("truetype"), url("../../fonts/generatepress.svg#GeneratePress") format("svg");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.menu-toggle:before,
|
||||
.search-item a:before,
|
||||
.dropdown-menu-toggle:before,
|
||||
.cat-links:before,
|
||||
.tags-links:before,
|
||||
.comments-link:before,
|
||||
.nav-previous .prev:before,
|
||||
.nav-next .next:before,
|
||||
.generate-back-to-top:before,
|
||||
.search-form .search-submit:before {
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font-style: normal;
|
||||
font-variant: normal;
|
||||
text-rendering: auto;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.cat-links:before,
|
||||
.tags-links:before,
|
||||
.comments-link:before,
|
||||
.nav-previous .prev:before,
|
||||
.nav-next .next:before {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Mobile Menu
|
||||
--------------------------------------------------------------*/
|
||||
.menu-toggle:before {
|
||||
content: "\f0c9";
|
||||
font-family: GeneratePress;
|
||||
width: 1.28571429em;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.toggled .menu-toggle:before {
|
||||
content: "\f00d";
|
||||
}
|
||||
|
||||
.main-navigation.toggled .sfHover > a .dropdown-menu-toggle:before {
|
||||
content: "\f106";
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Navigation Search
|
||||
--------------------------------------------------------------*/
|
||||
.search-item a:before {
|
||||
content: "\f002";
|
||||
font-family: GeneratePress;
|
||||
width: 1.28571429em;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.search-item.close-search a:before {
|
||||
content: "\f00d";
|
||||
}
|
||||
|
||||
.widget .search-form button:before {
|
||||
content: "\f002";
|
||||
font-family: GeneratePress;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Navigation Dropdowns
|
||||
--------------------------------------------------------------*/
|
||||
.dropdown-menu-toggle:before {
|
||||
content: "\f107";
|
||||
font-family: GeneratePress;
|
||||
display: inline-block;
|
||||
width: 0.8em;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
nav:not(.toggled) ul ul .dropdown-menu-toggle:before {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.dropdown-hover .sub-menu-left:not(.toggled) ul ul .dropdown-menu-toggle:before {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.dropdown-click .menu-item-has-children.sfHover > a .dropdown-menu-toggle:before {
|
||||
content: "\f106";
|
||||
}
|
||||
|
||||
.dropdown-hover nav:not(.toggled) ul ul .dropdown-menu-toggle:before {
|
||||
content: "\f105";
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Post Content
|
||||
--------------------------------------------------------------*/
|
||||
.entry-header .cat-links:before,
|
||||
.entry-header .tags-links:before,
|
||||
.entry-header .comments-link:before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.cat-links:before,
|
||||
.tags-links:before,
|
||||
.comments-link:before,
|
||||
.nav-previous .prev:before,
|
||||
.nav-next .next:before {
|
||||
font-family: GeneratePress;
|
||||
text-decoration: inherit;
|
||||
position: relative;
|
||||
margin-right: 0.6em;
|
||||
width: 13px;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.cat-links:before {
|
||||
content: "\f07b";
|
||||
}
|
||||
|
||||
.tags-links:before {
|
||||
content: "\f02c";
|
||||
}
|
||||
|
||||
.comments-link:before {
|
||||
content: "\f086";
|
||||
}
|
||||
|
||||
.nav-previous .prev:before {
|
||||
content: "\f104";
|
||||
}
|
||||
|
||||
.nav-next .next:before {
|
||||
content: "\f105";
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Sidebar Navigation
|
||||
--------------------------------------------------------------*/
|
||||
.dropdown-hover.both-right .inside-left-sidebar .dropdown-menu-toggle:before,
|
||||
.dropdown-hover .inside-right-sidebar .dropdown-menu-toggle:before {
|
||||
content: "\f104";
|
||||
}
|
||||
|
||||
.dropdown-hover.both-left .inside-right-sidebar .dropdown-menu-toggle:before,
|
||||
.dropdown-hover .inside-left-sidebar .dropdown-menu-toggle:before {
|
||||
content: "\f105";
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Back to Top Button
|
||||
--------------------------------------------------------------*/
|
||||
.generate-back-to-top:before {
|
||||
content: "\f106";
|
||||
font-family: GeneratePress;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Search button
|
||||
--------------------------------------------------------------*/
|
||||
.search-form .search-submit:before {
|
||||
content: "\f002";
|
||||
font-family: GeneratePress;
|
||||
width: 1.28571429em;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
}
|
@ -1 +0,0 @@
|
||||
@font-face{font-family:GeneratePress;src:url("../../fonts/generatepress.eot");src:url("../../fonts/generatepress.eot#iefix") format("embedded-opentype"),url("../../fonts/generatepress.woff2") format("woff2"),url("../../fonts/generatepress.woff") format("woff"),url("../../fonts/generatepress.ttf") format("truetype"),url("../../fonts/generatepress.svg#GeneratePress") format("svg");font-weight:400;font-style:normal}.cat-links:before,.comments-link:before,.dropdown-menu-toggle:before,.generate-back-to-top:before,.menu-toggle:before,.nav-next .next:before,.nav-previous .prev:before,.search-form .search-submit:before,.search-item a:before,.tags-links:before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.cat-links:before,.comments-link:before,.nav-next .next:before,.nav-previous .prev:before,.tags-links:before{opacity:.7}.menu-toggle:before{content:"\f0c9";font-family:GeneratePress;width:1.28571429em;text-align:center;display:inline-block}.toggled .menu-toggle:before{content:"\f00d"}.main-navigation.toggled .sfHover>a .dropdown-menu-toggle:before{content:"\f106"}.search-item a:before{content:"\f002";font-family:GeneratePress;width:1.28571429em;text-align:center;display:inline-block}.search-item.close-search a:before{content:"\f00d"}.widget .search-form button:before{content:"\f002";font-family:GeneratePress}.dropdown-menu-toggle:before{content:"\f107";font-family:GeneratePress;display:inline-block;width:.8em;text-align:left}nav:not(.toggled) ul ul .dropdown-menu-toggle:before{text-align:right}.dropdown-hover .sub-menu-left:not(.toggled) ul ul .dropdown-menu-toggle:before{transform:rotate(180deg)}.dropdown-click .menu-item-has-children.sfHover>a .dropdown-menu-toggle:before{content:"\f106"}.dropdown-hover nav:not(.toggled) ul ul .dropdown-menu-toggle:before{content:"\f105"}.entry-header .cat-links:before,.entry-header .comments-link:before,.entry-header .tags-links:before{display:none}.cat-links:before,.comments-link:before,.nav-next .next:before,.nav-previous .prev:before,.tags-links:before{font-family:GeneratePress;text-decoration:inherit;position:relative;margin-right:.6em;width:13px;text-align:center;display:inline-block}.cat-links:before{content:"\f07b"}.tags-links:before{content:"\f02c"}.comments-link:before{content:"\f086"}.nav-previous .prev:before{content:"\f104"}.nav-next .next:before{content:"\f105"}.dropdown-hover .inside-right-sidebar .dropdown-menu-toggle:before,.dropdown-hover.both-right .inside-left-sidebar .dropdown-menu-toggle:before{content:"\f104"}.dropdown-hover .inside-left-sidebar .dropdown-menu-toggle:before,.dropdown-hover.both-left .inside-right-sidebar .dropdown-menu-toggle:before{content:"\f105"}.generate-back-to-top:before{content:"\f106";font-family:GeneratePress}.search-form .search-submit:before{content:"\f002";font-family:GeneratePress;width:1.28571429em;text-align:center;display:inline-block}
|
@ -1,256 +0,0 @@
|
||||
/*--------------------------------------------------------------
|
||||
## Footer Widgets
|
||||
--------------------------------------------------------------*/
|
||||
.footer-widgets-container {
|
||||
padding: 40px;
|
||||
}
|
||||
|
||||
.inside-footer-widgets {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.inside-footer-widgets > div {
|
||||
flex: 1 1 0;
|
||||
}
|
||||
|
||||
.site-footer .footer-widgets-container .inner-padding {
|
||||
padding: 0px 0px 0px 40px;
|
||||
}
|
||||
|
||||
.site-footer .footer-widgets-container .inside-footer-widgets {
|
||||
margin-left: -40px;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
## Top Bar
|
||||
--------------------------------------------------------------*/
|
||||
.top-bar {
|
||||
font-weight: normal;
|
||||
text-transform: none;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.top-bar .inside-top-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.top-bar .inside-top-bar .widget {
|
||||
padding: 0;
|
||||
display: inline-block;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.top-bar .inside-top-bar .textwidget p:last-child {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.top-bar .widget-title {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.top-bar .widget {
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.top-bar .widget_nav_menu > div > ul {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.top-bar .widget_nav_menu li {
|
||||
margin: 0 10px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.top-bar .widget_nav_menu li:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.top-bar .widget_nav_menu li:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.top-bar .widget_nav_menu li ul {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.inside-top-bar {
|
||||
padding: 10px 40px;
|
||||
}
|
||||
|
||||
div.top-bar .widget {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.top-bar-align-right .widget {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.top-bar-align-right .widget:first-child {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.top-bar-align-right .widget:nth-child(even) {
|
||||
order: -20;
|
||||
}
|
||||
|
||||
.top-bar-align-right .widget:nth-child(2) {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.top-bar-align-left .widget {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.top-bar-align-left .widget:nth-child(odd) {
|
||||
order: -20;
|
||||
}
|
||||
|
||||
.top-bar-align-left .widget:nth-child(2) {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.top-bar-align-left .widget:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.top-bar-align-center .widget:first-child {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.top-bar-align-center .widget:last-child {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.top-bar-align-center .widget:not(:first-child):not(:last-child) {
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
## Footer Bar
|
||||
--------------------------------------------------------------*/
|
||||
.footer-bar-active .footer-bar .widget {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.footer-bar .widget_nav_menu > div > ul {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.footer-bar .widget_nav_menu li {
|
||||
margin: 0 10px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.footer-bar .widget_nav_menu li:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.footer-bar .widget_nav_menu li:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.footer-bar .widget_nav_menu li ul {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.footer-bar .textwidget p:last-child {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.footer-bar .widget-title {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.footer-bar-align-right .copyright-bar {
|
||||
order: -20;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.footer-bar-align-left .copyright-bar {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.footer-bar-align-center .inside-site-info {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.footer-bar-align-center .footer-bar {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.site-footer:not(.footer-bar-active) .copyright-bar {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
## Breakpoint (768px)
|
||||
--------------------------------------------------------------*/
|
||||
@media (max-width: 768px) {
|
||||
/*--------------------------------------------------------------
|
||||
## Top Bar
|
||||
--------------------------------------------------------------*/
|
||||
.top-bar .inside-top-bar {
|
||||
justify-content: center;
|
||||
}
|
||||
.top-bar .inside-top-bar > .widget {
|
||||
order: 1;
|
||||
margin: 0 10px;
|
||||
}
|
||||
.top-bar .inside-top-bar:first-child {
|
||||
margin-left: auto;
|
||||
}
|
||||
.top-bar .inside-top-bar:last-child {
|
||||
margin-right: auto;
|
||||
}
|
||||
.top-bar .widget_nav_menu li {
|
||||
padding: 5px 0;
|
||||
}
|
||||
.top-bar-align-center {
|
||||
text-align: center;
|
||||
}
|
||||
/*--------------------------------------------------------------
|
||||
## Footer
|
||||
--------------------------------------------------------------*/
|
||||
.inside-footer-widgets {
|
||||
flex-direction: column;
|
||||
}
|
||||
.inside-footer-widgets > div:not(:last-child) {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.site-footer .footer-widgets .footer-widgets-container .inside-footer-widgets {
|
||||
margin: 0;
|
||||
}
|
||||
.site-footer .footer-widgets .footer-widgets-container .inner-padding {
|
||||
padding: 0;
|
||||
}
|
||||
.footer-bar-active .inside-site-info {
|
||||
flex-direction: column;
|
||||
}
|
||||
.footer-bar-active .footer-bar {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.footer-bar .widget_nav_menu > div > ul {
|
||||
justify-content: center;
|
||||
}
|
||||
.footer-bar .widget_nav_menu li {
|
||||
padding: 5px 0;
|
||||
}
|
||||
.footer-bar .widget_nav_menu li:first-child {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.footer-bar .widget_nav_menu li:last-child {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.footer-bar-align-left .copyright-bar {
|
||||
margin-left: 0;
|
||||
}
|
||||
.footer-bar-align-right .copyright-bar {
|
||||
order: unset;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
.footer-widgets-container{padding:40px}.inside-footer-widgets{display:flex}.inside-footer-widgets>div{flex:1 1 0}.site-footer .footer-widgets-container .inner-padding{padding:0 0 0 40px}.site-footer .footer-widgets-container .inside-footer-widgets{margin-left:-40px}.top-bar{font-weight:400;text-transform:none;font-size:13px}.top-bar .inside-top-bar{display:flex;align-items:center;flex-wrap:wrap}.top-bar .inside-top-bar .widget{padding:0;display:inline-block;margin-bottom:0}.top-bar .inside-top-bar .textwidget p:last-child{margin:0}.top-bar .widget-title{display:none}.top-bar .widget{margin:0 10px}.top-bar .widget_nav_menu>div>ul{display:flex;align-items:center}.top-bar .widget_nav_menu li{margin:0 10px;padding:0}.top-bar .widget_nav_menu li:first-child{margin-left:0}.top-bar .widget_nav_menu li:last-child{margin-right:0}.top-bar .widget_nav_menu li ul{display:none}.inside-top-bar{padding:10px 40px}div.top-bar .widget{margin-bottom:0}.top-bar-align-right .widget{margin-right:0}.top-bar-align-right .widget:first-child{margin-left:auto}.top-bar-align-right .widget:nth-child(2n){order:-20}.top-bar-align-right .widget:nth-child(2){margin-left:0}.top-bar-align-left .widget{margin-left:0}.top-bar-align-left .widget:nth-child(odd){order:-20}.top-bar-align-left .widget:nth-child(2){margin-left:auto}.top-bar-align-left .widget:last-child{margin-right:0}.top-bar-align-center .widget:first-child{margin-left:auto}.top-bar-align-center .widget:last-child{margin-right:auto}.top-bar-align-center .widget:not(:first-child):not(:last-child){margin:0 5px}.footer-bar-active .footer-bar .widget{padding:0}.footer-bar .widget_nav_menu>div>ul{display:flex;align-items:center;flex-wrap:wrap}.footer-bar .widget_nav_menu li{margin:0 10px;padding:0}.footer-bar .widget_nav_menu li:first-child{margin-left:0}.footer-bar .widget_nav_menu li:last-child{margin-right:0}.footer-bar .widget_nav_menu li ul{display:none}.footer-bar .textwidget p:last-child{margin:0}.footer-bar .widget-title{display:none}.footer-bar-align-right .copyright-bar{order:-20;margin-right:auto}.footer-bar-align-left .copyright-bar{margin-left:auto}.footer-bar-align-center .inside-site-info{flex-direction:column}.footer-bar-align-center .footer-bar{margin-bottom:10px}.site-footer:not(.footer-bar-active) .copyright-bar{margin:0 auto}@media (max-width:768px){.top-bar .inside-top-bar{justify-content:center}.top-bar .inside-top-bar>.widget{order:1;margin:0 10px}.top-bar .inside-top-bar:first-child{margin-left:auto}.top-bar .inside-top-bar:last-child{margin-right:auto}.top-bar .widget_nav_menu li{padding:5px 0}.top-bar-align-center{text-align:center}.inside-footer-widgets{flex-direction:column}.inside-footer-widgets>div:not(:last-child){margin-bottom:40px}.site-footer .footer-widgets .footer-widgets-container .inside-footer-widgets{margin:0}.site-footer .footer-widgets .footer-widgets-container .inner-padding{padding:0}.footer-bar-active .inside-site-info{flex-direction:column}.footer-bar-active .footer-bar{margin-bottom:10px}.footer-bar .widget_nav_menu>div>ul{justify-content:center}.footer-bar .widget_nav_menu li{padding:5px 0}.footer-bar .widget_nav_menu li:first-child{margin-left:10px}.footer-bar .widget_nav_menu li:last-child{margin-right:10px}.footer-bar-align-left .copyright-bar{margin-left:0}.footer-bar-align-right .copyright-bar{order:unset;margin-right:0}}
|
@ -1,195 +0,0 @@
|
||||
caption,
|
||||
td,
|
||||
th {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.header-aligned-right:not([class*="nav-float-"]) .inside-header {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.header-aligned-left:not([class*="nav-float-"]) .inside-header {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.header-aligned-right:not([class*="nav-float-"]) .header-widget {
|
||||
order: 10;
|
||||
}
|
||||
|
||||
.header-aligned-left:not([class*="nav-float-"]) .header-widget {
|
||||
order: -10;
|
||||
}
|
||||
|
||||
.site-logo + .site-branding {
|
||||
order: -1;
|
||||
}
|
||||
|
||||
.nav-float-right #site-navigation {
|
||||
order: -5;
|
||||
}
|
||||
|
||||
.nav-float-right #site-navigation.toggled, .nav-float-right #site-navigation.has-active-search {
|
||||
order: 10;
|
||||
}
|
||||
|
||||
.nav-float-right .header-widget {
|
||||
order: -10;
|
||||
}
|
||||
|
||||
.nav-float-left #site-navigation {
|
||||
order: 5;
|
||||
}
|
||||
|
||||
.nav-float-left .header-widget,
|
||||
.nav-float-left .mobile-menu-control-wrapper {
|
||||
order: 10;
|
||||
}
|
||||
|
||||
.mobile-menu-control-wrapper {
|
||||
margin-right: auto;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.nav-align-right .inside-navigation {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.nav-align-left .inside-navigation {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.menu-item-has-children .dropdown-menu-toggle {
|
||||
float: left !important;
|
||||
}
|
||||
|
||||
.main-navigation ul ul {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.sidebar .menu-item-has-children .dropdown-menu-toggle,
|
||||
nav ul ul .menu-item-has-children .dropdown-menu-toggle {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.comment-meta .avatar {
|
||||
float: right;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.page-header .avatar {
|
||||
float: right;
|
||||
margin-left: 1.5em;
|
||||
}
|
||||
|
||||
.slideout-navigation .menu-item-has-children .dropdown-menu-toggle {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.dropdown-click #generate-slideout-menu .slideout-menu .menu-item-has-children > a:first-child,
|
||||
.slideout-desktop.dropdown-hover #generate-slideout-menu .slideout-menu .menu-item-has-children > a:first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.comment .children {
|
||||
padding-right: 30px;
|
||||
border-right: 1px solid rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.main-navigation .main-nav ul li.menu-item-has-children > a,
|
||||
.secondary-navigation .main-nav ul li.menu-item-has-children > a {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
nav:not(.toggled) ul ul .menu-item-has-children .dropdown-menu-toggle {
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
nav:not(.toggled) .menu-item-has-children .dropdown-menu-toggle {
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.main-navigation {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul {
|
||||
margin: 0 3em 1.5em 0;
|
||||
}
|
||||
|
||||
li > ol,
|
||||
li > ul {
|
||||
margin-right: 1.5em;
|
||||
}
|
||||
|
||||
.menu-toggle .mobile-menu {
|
||||
margin-right: 5px;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.widget_categories .children {
|
||||
margin-right: 1.5em;
|
||||
}
|
||||
|
||||
.widget_nav_menu ul ul,
|
||||
.widget_pages ul ul {
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
.cat-links:before,
|
||||
.comments-link:before,
|
||||
.nav-next .next:before,
|
||||
.nav-previous .prev:before,
|
||||
.tags-links:before {
|
||||
margin-left: 0.6em;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.entry-meta .gp-icon {
|
||||
margin-right: 0;
|
||||
margin-left: 0.6em;
|
||||
}
|
||||
|
||||
.menu-toggle,
|
||||
.nav-search-enabled .main-navigation .menu-toggle {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.rtl .navigation-search {
|
||||
left: auto;
|
||||
right: -99999px;
|
||||
}
|
||||
|
||||
.rtl .navigation-search.nav-search-active {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.main-navigation.toggled .main-nav li {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.left-sidebar .sidebar,
|
||||
.both-left #left-sidebar,
|
||||
.both-sidebars #left-sidebar {
|
||||
order: 10;
|
||||
}
|
||||
|
||||
.both-left #right-sidebar {
|
||||
order: 5;
|
||||
}
|
||||
|
||||
.both-right #left-sidebar {
|
||||
order: -5;
|
||||
}
|
||||
|
||||
.both-right #right-sidebar,
|
||||
.both-sidebars #right-sidebar,
|
||||
.right-sidebar #right-sidebar {
|
||||
order: -10;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.site-content .content-area {
|
||||
order: -20;
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
caption,td,th{text-align:right}.header-aligned-right:not([class*=nav-float-]) .inside-header{justify-content:flex-start}.header-aligned-left:not([class*=nav-float-]) .inside-header{justify-content:flex-end}.header-aligned-right:not([class*=nav-float-]) .header-widget{order:10}.header-aligned-left:not([class*=nav-float-]) .header-widget{order:-10}.site-logo+.site-branding{order:-1}.nav-float-right #site-navigation{order:-5}.nav-float-right #site-navigation.has-active-search,.nav-float-right #site-navigation.toggled{order:10}.nav-float-right .header-widget{order:-10}.nav-float-left #site-navigation{order:5}.nav-float-left .header-widget,.nav-float-left .mobile-menu-control-wrapper{order:10}.mobile-menu-control-wrapper{margin-right:auto;margin-left:0}.nav-align-right .inside-navigation{justify-content:flex-start}.nav-align-left .inside-navigation{justify-content:flex-end}.menu-item-has-children .dropdown-menu-toggle{float:left!important}.main-navigation ul ul{text-align:right}.sidebar .menu-item-has-children .dropdown-menu-toggle,nav ul ul .menu-item-has-children .dropdown-menu-toggle{float:left}.comment-meta .avatar{float:right;margin-left:10px}.page-header .avatar{float:right;margin-left:1.5em}.slideout-navigation .menu-item-has-children .dropdown-menu-toggle{float:left}.dropdown-click #generate-slideout-menu .slideout-menu .menu-item-has-children>a:first-child,.slideout-desktop.dropdown-hover #generate-slideout-menu .slideout-menu .menu-item-has-children>a:first-child{padding-left:0}.comment .children{padding-right:30px;border-right:1px solid rgba(0,0,0,.05)}.main-navigation .main-nav ul li.menu-item-has-children>a,.secondary-navigation .main-nav ul li.menu-item-has-children>a{padding-left:0}nav:not(.toggled) ul ul .menu-item-has-children .dropdown-menu-toggle{padding-left:15px}nav:not(.toggled) .menu-item-has-children .dropdown-menu-toggle{padding-right:10px}.main-navigation{padding-right:0}ol,ul{margin:0 3em 1.5em 0}li>ol,li>ul{margin-right:1.5em}.menu-toggle .mobile-menu{margin-right:5px;margin-left:0}.widget_categories .children{margin-right:1.5em}.widget_nav_menu ul ul,.widget_pages ul ul{margin-right:1em}.cat-links:before,.comments-link:before,.nav-next .next:before,.nav-previous .prev:before,.tags-links:before{margin-left:.6em;margin-right:0}.entry-meta .gp-icon{margin-right:0;margin-left:.6em}.menu-toggle,.nav-search-enabled .main-navigation .menu-toggle{text-align:right}.rtl .navigation-search{left:auto;right:-99999px}.rtl .navigation-search.nav-search-active{right:0}.main-navigation.toggled .main-nav li{text-align:right}.both-left #left-sidebar,.both-sidebars #left-sidebar,.left-sidebar .sidebar{order:10}.both-left #right-sidebar{order:5}.both-right #left-sidebar{order:-5}.both-right #right-sidebar,.both-sidebars #right-sidebar,.right-sidebar #right-sidebar{order:-10}@media (max-width:768px){.site-content .content-area{order:-20}}
|
@ -1,258 +0,0 @@
|
||||
/*--------------------------------------------------------------
|
||||
# Mobile Menu
|
||||
--------------------------------------------------------------*/
|
||||
.menu-toggle,
|
||||
.mobile-bar-items,
|
||||
.sidebar-nav-mobile {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.menu-toggle {
|
||||
padding: 0 20px;
|
||||
line-height: 60px;
|
||||
margin: 0;
|
||||
font-weight: normal;
|
||||
text-transform: none;
|
||||
font-size: 15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button.menu-toggle {
|
||||
background-color: transparent;
|
||||
width: 100%;
|
||||
border: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
button.menu-toggle:hover,
|
||||
button.menu-toggle:active,
|
||||
button.menu-toggle:focus {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.menu-toggle .mobile-menu {
|
||||
padding-left: 3px;
|
||||
}
|
||||
|
||||
.menu-toggle .gp-icon + .mobile-menu {
|
||||
padding-left: 9px;
|
||||
}
|
||||
|
||||
.menu-toggle .mobile-menu:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.nav-search-enabled .main-navigation .menu-toggle {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.mobile-bar-items {
|
||||
display: none;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
z-index: 21;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.mobile-bar-items a {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
nav.toggled ul ul.sub-menu {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dropdown-hover .main-navigation.toggled ul li:hover > ul,
|
||||
.dropdown-hover .main-navigation.toggled ul li.sfHover > ul {
|
||||
transition-delay: 0s;
|
||||
}
|
||||
|
||||
.toggled .menu-item-has-children .dropdown-menu-toggle {
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.main-navigation.toggled ul ul {
|
||||
transition: 0s;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.main-navigation.toggled .main-nav > ul {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.main-navigation.toggled .main-nav ul ul.toggled-on {
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: auto !important;
|
||||
right: auto !important;
|
||||
width: 100%;
|
||||
pointer-events: auto;
|
||||
height: auto;
|
||||
opacity: 1;
|
||||
display: block;
|
||||
visibility: visible;
|
||||
float: none;
|
||||
}
|
||||
|
||||
.main-navigation.toggled .main-nav li {
|
||||
float: none;
|
||||
clear: both;
|
||||
display: block;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.main-navigation.toggled .main-nav li.hide-on-mobile {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.main-navigation.toggled .menu-item-has-children .dropdown-menu-toggle {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.main-navigation.toggled .menu li.search-item {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.main-navigation.toggled .sf-menu > li.menu-item-float-right {
|
||||
float: none;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------
|
||||
# Breakpoint (768px)
|
||||
--------------------------------------------------------------*/
|
||||
@media (max-width: 768px) {
|
||||
/*--------------------------------------------------------------
|
||||
## Links
|
||||
--------------------------------------------------------------*/
|
||||
a, body, button, input, select, textarea {
|
||||
transition: all 0s ease-in-out;
|
||||
}
|
||||
/*--------------------------------------------------------------
|
||||
## Top Bar
|
||||
--------------------------------------------------------------*/
|
||||
.top-bar.top-bar-align-left,
|
||||
.top-bar.top-bar-align-right {
|
||||
text-align: center;
|
||||
}
|
||||
.top-bar .widget {
|
||||
float: none !important;
|
||||
margin: 0 10px !important;
|
||||
}
|
||||
.top-bar .widget_nav_menu li {
|
||||
float: none;
|
||||
display: inline-block;
|
||||
padding: 5px 0;
|
||||
}
|
||||
.footer-bar .widget_nav_menu li:first-child {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.footer-bar .widget_nav_menu li:last-child {
|
||||
margin-right: 10px;
|
||||
}
|
||||
/*--------------------------------------------------------------
|
||||
## Header
|
||||
--------------------------------------------------------------*/
|
||||
.inside-header > *:not(:last-child):not(.main-navigation) {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.site-header,
|
||||
.header-aligned-right .site-header {
|
||||
text-align: center;
|
||||
}
|
||||
.header-widget {
|
||||
float: none;
|
||||
max-width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
/*--------------------------------------------------------------
|
||||
## Content Area
|
||||
--------------------------------------------------------------*/
|
||||
.sidebar,
|
||||
.content-area,
|
||||
.inside-footer-widgets > div {
|
||||
float: none;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
.site-main {
|
||||
margin-left: 0 !important;
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
body:not(.no-sidebar) .site-main {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
.one-container .sidebar {
|
||||
margin-top: 40px;
|
||||
}
|
||||
.separate-containers #left-sidebar + #right-sidebar .inside-right-sidebar {
|
||||
margin-top: 0;
|
||||
}
|
||||
.both-right.separate-containers .inside-left-sidebar,
|
||||
.both-left.separate-containers .inside-left-sidebar,
|
||||
.both-right.separate-containers .inside-right-sidebar,
|
||||
.both-left.separate-containers .inside-right-sidebar {
|
||||
margin-right: 0;
|
||||
margin-left: 0;
|
||||
}
|
||||
.alignleft,
|
||||
.alignright {
|
||||
float: none;
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
.post-image-aligned-left .post-image,
|
||||
.post-image-aligned-right .post-image {
|
||||
float: none;
|
||||
margin: 2em 0;
|
||||
text-align: center;
|
||||
}
|
||||
.comment .children {
|
||||
padding-left: 10px;
|
||||
margin-left: 0;
|
||||
}
|
||||
.edd_download {
|
||||
display: block;
|
||||
float: none !important;
|
||||
margin-bottom: 1.5em;
|
||||
width: 100% !important;
|
||||
}
|
||||
.entry-meta {
|
||||
font-size: inherit;
|
||||
}
|
||||
.entry-meta a {
|
||||
line-height: 1.8em;
|
||||
}
|
||||
/*--------------------------------------------------------------
|
||||
## Footer
|
||||
--------------------------------------------------------------*/
|
||||
.site-info {
|
||||
text-align: center;
|
||||
}
|
||||
.copyright-bar {
|
||||
float: none !important;
|
||||
text-align: center !important;
|
||||
}
|
||||
.footer-bar {
|
||||
float: none !important;
|
||||
text-align: center !important;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.footer-bar .widget_nav_menu li {
|
||||
float: none;
|
||||
display: inline-block;
|
||||
padding: 5px 0;
|
||||
}
|
||||
.inside-footer-widgets > div:not(:last-child) {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.site-footer .footer-widgets .footer-widgets-container .inside-footer-widgets {
|
||||
margin: 0;
|
||||
}
|
||||
.site-footer .footer-widgets .footer-widgets-container .inner-padding {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
.menu-toggle,.mobile-bar-items,.sidebar-nav-mobile{display:none}.menu-toggle{padding:0 20px;line-height:60px;margin:0;font-weight:400;text-transform:none;font-size:15px;cursor:pointer}button.menu-toggle{background-color:transparent;width:100%;border:0;text-align:center}button.menu-toggle:active,button.menu-toggle:focus,button.menu-toggle:hover{background-color:transparent}.menu-toggle .mobile-menu{padding-left:3px}.menu-toggle .gp-icon+.mobile-menu{padding-left:9px}.menu-toggle .mobile-menu:empty{display:none}.nav-search-enabled .main-navigation .menu-toggle{text-align:left}.mobile-bar-items{display:none;position:absolute;right:0;top:0;z-index:21;list-style-type:none}.mobile-bar-items a{display:inline-block}nav.toggled ul ul.sub-menu{width:100%}.dropdown-hover .main-navigation.toggled ul li.sfHover>ul,.dropdown-hover .main-navigation.toggled ul li:hover>ul{transition-delay:0s}.toggled .menu-item-has-children .dropdown-menu-toggle{padding-left:20px}.main-navigation.toggled ul ul{transition:0s;visibility:hidden}.main-navigation.toggled .main-nav>ul{display:block}.main-navigation.toggled .main-nav ul ul.toggled-on{position:relative;top:0;left:auto!important;right:auto!important;width:100%;pointer-events:auto;height:auto;opacity:1;display:block;visibility:visible;float:none}.main-navigation.toggled .main-nav li{float:none;clear:both;display:block;text-align:left}.main-navigation.toggled .main-nav li.hide-on-mobile{display:none!important}.main-navigation.toggled .menu-item-has-children .dropdown-menu-toggle{float:right}.main-navigation.toggled .menu li.search-item{display:none!important}.main-navigation.toggled .sf-menu>li.menu-item-float-right{float:none;display:inline-block}@media (max-width:768px){a,body,button,input,select,textarea{transition:all 0s ease-in-out}.top-bar.top-bar-align-left,.top-bar.top-bar-align-right{text-align:center}.top-bar .widget{float:none!important;margin:0 10px!important}.top-bar .widget_nav_menu li{float:none;display:inline-block;padding:5px 0}.footer-bar .widget_nav_menu li:first-child{margin-left:10px}.footer-bar .widget_nav_menu li:last-child{margin-right:10px}.inside-header>:not(:last-child):not(.main-navigation){margin-bottom:20px}.header-aligned-right .site-header,.site-header{text-align:center}.header-widget{float:none;max-width:100%;text-align:center}.content-area,.inside-footer-widgets>div,.sidebar{float:none;width:100%;left:0;right:0}.site-main{margin-left:0!important;margin-right:0!important}body:not(.no-sidebar) .site-main{margin-bottom:0!important}.one-container .sidebar{margin-top:40px}.separate-containers #left-sidebar+#right-sidebar .inside-right-sidebar{margin-top:0}.both-left.separate-containers .inside-left-sidebar,.both-left.separate-containers .inside-right-sidebar,.both-right.separate-containers .inside-left-sidebar,.both-right.separate-containers .inside-right-sidebar{margin-right:0;margin-left:0}.alignleft,.alignright{float:none;display:block;margin-left:auto;margin-right:auto}.post-image-aligned-left .post-image,.post-image-aligned-right .post-image{float:none;margin:2em 0;text-align:center}.comment .children{padding-left:10px;margin-left:0}.edd_download{display:block;float:none!important;margin-bottom:1.5em;width:100%!important}.entry-meta{font-size:inherit}.entry-meta a{line-height:1.8em}.site-info{text-align:center}.copyright-bar{float:none!important;text-align:center!important}.footer-bar{float:none!important;text-align:center!important;margin-bottom:20px}.footer-bar .widget_nav_menu li{float:none;display:inline-block;padding:5px 0}.inside-footer-widgets>div:not(:last-child){margin-bottom:40px}.site-footer .footer-widgets .footer-widgets-container .inside-footer-widgets{margin:0}.site-footer .footer-widgets .footer-widgets-container .inner-padding{padding:0}}
|
@ -1,178 +0,0 @@
|
||||
caption,
|
||||
td,
|
||||
th {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.menu-item-has-children .dropdown-menu-toggle {
|
||||
float: left !important;
|
||||
}
|
||||
|
||||
.main-navigation li {
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.main-navigation li.search-item,
|
||||
.nav-aligned-right.nav-below-header .main-navigation .menu > li.search-item {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.nav-left-sidebar .main-navigation li.search-item.current-menu-item,
|
||||
.nav-right-sidebar .main-navigation li.search-item.current-menu-item {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.rtl.nav-aligned-left .main-navigation .menu > li {
|
||||
float: none;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.rtl.nav-aligned-left .main-navigation ul {
|
||||
letter-spacing: -0.31em;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.rtl.nav-aligned-left .main-navigation ul li {
|
||||
letter-spacing: normal;
|
||||
}
|
||||
|
||||
.rtl.nav-aligned-left .main-navigation {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.sidebar .menu-item-has-children .dropdown-menu-toggle,
|
||||
nav ul ul .menu-item-has-children .dropdown-menu-toggle {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.comment-meta .avatar {
|
||||
float: right;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.page-header .avatar {
|
||||
float: right;
|
||||
margin-left: 1.5em;
|
||||
}
|
||||
|
||||
.header-widget {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.sf-menu > li.menu-item-float-right {
|
||||
float: left !important;
|
||||
}
|
||||
|
||||
.slideout-navigation .menu-item-has-children .dropdown-menu-toggle {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.dropdown-click #generate-slideout-menu .slideout-menu .menu-item-has-children > a:first-child,
|
||||
.slideout-desktop.dropdown-hover #generate-slideout-menu .slideout-menu .menu-item-has-children > a:first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.comment .children {
|
||||
padding-right: 30px;
|
||||
border-right: 1px solid rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.main-navigation .main-nav ul li.menu-item-has-children > a,
|
||||
.secondary-navigation .main-nav ul li.menu-item-has-children > a {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
nav:not(.toggled) ul ul .menu-item-has-children .dropdown-menu-toggle {
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
nav:not(.toggled) .menu-item-has-children .dropdown-menu-toggle {
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.main-navigation ul,
|
||||
.menu-toggle li.search-item {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul {
|
||||
margin: 0 3em 1.5em 0;
|
||||
}
|
||||
|
||||
li > ol,
|
||||
li > ul {
|
||||
margin-right: 1.5em;
|
||||
}
|
||||
|
||||
.menu-toggle .mobile-menu {
|
||||
margin-right: 5px;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.widget_categories .children {
|
||||
margin-right: 1.5em;
|
||||
}
|
||||
|
||||
.widget_nav_menu ul ul,
|
||||
.widget_pages ul ul {
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
.cat-links:before,
|
||||
.comments-link:before,
|
||||
.nav-next .next:before,
|
||||
.nav-previous .prev:before,
|
||||
.tags-links:before {
|
||||
margin-left: 0.6em;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.menu-toggle,
|
||||
.nav-search-enabled .main-navigation .menu-toggle {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.main-navigation .mobile-bar-items {
|
||||
float: left;
|
||||
left: 0;
|
||||
right: auto;
|
||||
}
|
||||
|
||||
.rtl .navigation-search {
|
||||
left: auto;
|
||||
right: -999999px;
|
||||
}
|
||||
|
||||
.rtl .navigation-search.nav-search-active {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.rtl .footer-bar .widget_nav_menu li {
|
||||
direction: rtl;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.main-navigation.toggled .main-nav li {
|
||||
text-align: right !important;
|
||||
}
|
||||
|
||||
.entry-meta .gp-icon {
|
||||
margin-right: 0;
|
||||
margin-left: 0.6em;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.rtl .mobile-bar-items {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.inside-footer-widgets > div {
|
||||
float: right;
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
caption,td,th{text-align:right}.menu-item-has-children .dropdown-menu-toggle{float:left!important}.main-navigation li{float:right;text-align:right}.main-navigation li.search-item,.nav-aligned-right.nav-below-header .main-navigation .menu>li.search-item{float:left}.nav-left-sidebar .main-navigation li.search-item.current-menu-item,.nav-right-sidebar .main-navigation li.search-item.current-menu-item{float:left}.rtl.nav-aligned-left .main-navigation .menu>li{float:none;display:inline-block}.rtl.nav-aligned-left .main-navigation ul{letter-spacing:-.31em;font-size:1em}.rtl.nav-aligned-left .main-navigation ul li{letter-spacing:normal}.rtl.nav-aligned-left .main-navigation{text-align:left}.sidebar .menu-item-has-children .dropdown-menu-toggle,nav ul ul .menu-item-has-children .dropdown-menu-toggle{float:left}.comment-meta .avatar{float:right;margin-left:10px}.page-header .avatar{float:right;margin-left:1.5em}.header-widget{float:left}.sf-menu>li.menu-item-float-right{float:left!important}.slideout-navigation .menu-item-has-children .dropdown-menu-toggle{float:left}.dropdown-click #generate-slideout-menu .slideout-menu .menu-item-has-children>a:first-child,.slideout-desktop.dropdown-hover #generate-slideout-menu .slideout-menu .menu-item-has-children>a:first-child{padding-left:0}.comment .children{padding-right:30px;border-right:1px solid rgba(0,0,0,.05)}.main-navigation .main-nav ul li.menu-item-has-children>a,.secondary-navigation .main-nav ul li.menu-item-has-children>a{padding-left:0}nav:not(.toggled) ul ul .menu-item-has-children .dropdown-menu-toggle{padding-left:15px}nav:not(.toggled) .menu-item-has-children .dropdown-menu-toggle{padding-right:10px}.main-navigation ul,.menu-toggle li.search-item{padding-right:0}ol,ul{margin:0 3em 1.5em 0}li>ol,li>ul{margin-right:1.5em}.menu-toggle .mobile-menu{margin-right:5px;margin-left:0}.widget_categories .children{margin-right:1.5em}.widget_nav_menu ul ul,.widget_pages ul ul{margin-right:1em}.cat-links:before,.comments-link:before,.nav-next .next:before,.nav-previous .prev:before,.tags-links:before{margin-left:.6em;margin-right:0}.menu-toggle,.nav-search-enabled .main-navigation .menu-toggle{text-align:right}.main-navigation .mobile-bar-items{float:left;left:0;right:auto}.rtl .navigation-search{left:auto;right:-999999px}.rtl .navigation-search.nav-search-active{right:0}.rtl .footer-bar .widget_nav_menu li{direction:rtl;float:right}.main-navigation.toggled .main-nav li{text-align:right!important}.entry-meta .gp-icon{margin-right:0;margin-left:.6em}@media (max-width:768px){.rtl .mobile-bar-items{position:absolute;left:0;top:0}}@media (min-width:768px){.inside-footer-widgets>div{float:right}}
|
@ -1 +0,0 @@
|
||||
<?php return array('dependencies' => array('wp-data', 'wp-dom-ready', 'wp-element', 'wp-plugins'), 'version' => '166c384f313c8f5d9914');
|
@ -1 +0,0 @@
|
||||
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '42a74b551d83e1b85238');
|
@ -1 +0,0 @@
|
||||
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'dbc22cbe57941af36094');
|
@ -1 +0,0 @@
|
||||
<?php return array('dependencies' => array(), 'version' => 'b4d4871691423abff87b');
|
@ -1 +0,0 @@
|
||||
!function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(t,n){if(t){if("string"==typeof t)return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var n=function(e){var n=e.targetModal,r=e.openTrigger,o=e.triggers,a=void 0===o?[]:o,i=document.getElementById(n);if(i){var s={openTrigger:r,closeTrigger:"data-gpmodal-close",openClass:"gp-modal--open"},l="";a.length>0&&function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.filter(Boolean).forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault(),c()})),e.addEventListener("keydown",(function(e){" "!==e.key&&"Enter"!==e.key&&"Spacebar"!==e.key||(e.preventDefault(),c())}))}))}.apply(void 0,t(a))}function c(){i.classList.add("gp-modal--transition"),l=document.activeElement,i.classList.add(s.openClass),u("disable"),i.addEventListener("touchstart",f),i.addEventListener("click",f),document.addEventListener("keydown",g),function(){var e=v();if(0!==e.length){var t=e.filter((function(e){return!e.hasAttribute(s.closeTrigger)}));t.length>0&&t[0].focus(),0===t.length&&e[0].focus()}}(),setTimeout((function(){return i.classList.remove("gp-modal--transition")}),100)}function d(){i.classList.add("gp-modal--transition"),i.removeEventListener("touchstart",f),i.removeEventListener("click",f),document.removeEventListener("keydown",g),u("enable"),l&&l.focus&&l.focus(),i.classList.remove(s.openClass),setTimeout((function(){return i.classList.remove("gp-modal--transition")}),500)}function u(e){var t=document.querySelector("body");switch(e){case"enable":Object.assign(t.style,{overflow:""});break;case"disable":Object.assign(t.style,{overflow:"hidden"})}}function f(e){(e.target.hasAttribute(s.closeTrigger)||e.target.parentNode.hasAttribute(s.closeTrigger))&&(e.preventDefault(),e.stopPropagation(),d())}function g(e){27===e.keyCode&&d(),9===e.keyCode&&function(e){var t=v();if(0!==t.length){var n=(t=t.filter((function(e){return null!==e.offsetParent}))).indexOf(document.activeElement);e.shiftKey&&0===n&&(t[t.length-1].focus(),e.preventDefault()),!e.shiftKey&&t.length>0&&n===t.length-1&&(t[0].focus(),e.preventDefault())}}(e)}function v(){var e=i.querySelectorAll(["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])']);return Array.apply(void 0,t(e))}},r=Object.assign({},{openTrigger:"data-gpmodal-trigger"}),o=t(document.querySelectorAll("[".concat(r.openTrigger,"]"))).reduce((function(e,t){var n=t.attributes[r.openTrigger].value;return e[n]=e[n]||[],e[n].push(t),e}),[]);for(var a in o){var i=o[a];r.targetModal=a,r.triggers=t(i),new n(r)}}();
|
@ -1,9 +0,0 @@
|
||||
.components-base-control__help{margin-bottom:0;margin-top:2px}.components-base-control__label{display:block;margin-bottom:10px}.generate-customize-control-wrapper{display:flex}.generate-customize-control-wrapper[data-wrapper-type=color]>div:first-child{flex-grow:1}.generate-customize-control-wrapper[data-wrapper-type=color]>div:not(:first-child):not(:empty){margin-left:5px}.generate-customize-control-wrapper[data-wrapper-type=two-col]>div{flex-basis:calc(50% - 5px)}.generate-customize-control-wrapper[data-wrapper-type=two-col]>div:nth-child(odd){margin-right:5px}.generate-customize-control-wrapper[data-wrapper-type=two-col]>div:nth-child(2n){margin-left:5px}.generate-customize-control--popover>.components-popover__content{box-sizing:border-box;padding:15px;width:280px}.generate-customize-control--popover .components-base-control:not(:last-child){margin-bottom:15px}.customize-control[data-toggleid]{display:none}#customize-control-generate_settings-google_font_display{display:flex;flex-direction:column;margin-top:10px}#customize-control-generate_settings-google_font_display .description{margin-bottom:0;margin-top:5px;order:10}
|
||||
.generate-component-color-picker{padding:5px 15px 5px 5px}
|
||||
.generate-component-color-picker .components-color-picker{box-sizing:border-box}.generate-component-color-picker .components-color-picker__inputs-wrapper{display:none}.generate-component-color-picker .react-colorful{width:100%!important}.generate-component-color-picker .react-colorful .react-colorful__pointer{height:20px;width:20px}.generate-component-color-picker .react-colorful .react-colorful__saturation{height:150px}.generate-component-color-picker .generate-color-input-wrapper{display:flex;padding:0}.generate-component-color-picker .generate-color-input-wrapper .generate-color-input{flex-grow:1}.generate-component-color-picker .generate-color-input-wrapper .components-color-clear-color{margin-left:5px}.generate-component-color-picker .generate-color-input-wrapper input{margin-right:5px}.generate-component-color-picker .generate-color-input-wrapper .components-base-control__field,.generate-component-color-picker>.components-base-control:first-child{margin-bottom:0}.generate-component-color-picker .components-color-picker__inputs-wrapper{min-width:auto}.generate-component-color-picker .generate-component-color-picker-palette{padding:16px 0 0}.generate-component-color-picker .generate-component-color-picker-palette .components-circular-option-picker{display:flex;flex-wrap:wrap}.generate-component-color-picker .generate-component-color-picker-palette .components-circular-option-picker .components-circular-option-picker__swatches{display:flex;flex-wrap:wrap;gap:6px}.generate-component-color-picker .components-color-palette,.generate-component-color-picker .generate-component-color-picker-palette .components-circular-option-picker .components-circular-option-picker__swatches .components-circular-option-picker__option-wrapper{margin:0}.generate-component-color-picker .components-color-picker{padding:5px;width:100%}.generate-component-color-picker .components-color-picker__body{padding-bottom:0}.generate-component-color-picker .components-popover__content{box-sizing:border-box;padding:10px;width:295px}.generate-component-color-picker .components-color-clear-color{height:auto}.generate-component-color-picker .components-circular-option-picker__option.is-pressed+svg{fill:#fff;background:#000;transform:scale(.6)}@media screen and (max-width:1666px){.generate-component-color-picker .components-popover__content{width:265px}}.generate-customize-control-wrapper{display:flex}.generate-customize-control-wrapper.generate-customize-color-control-wrapper>div:first-child{flex-grow:1}.generate-customize-control-wrapper.generate-customize-color-control-wrapper>div:not(:last-child){margin-right:5px}.generate-component-color-picker-wrapper>.components-base-control__field{align-items:center;display:flex;justify-content:space-between;position:relative}.generate-component-color-picker-wrapper>.components-base-control__field .components-color-palette__item-wrapper{margin:0}.generate-color-picker-area button,.generate-component-color-picker-palette button{height:28px;position:relative;width:28px}.generate-color-picker-area button:hover,.generate-component-color-picker-palette button:hover{background-color:inherit}.generate-color-picker-area button:focus:after,.generate-component-color-picker-palette button:focus:after{border:0;box-shadow:inset 0 0 0 2px #757575;height:28px;left:0;top:0;transform:none;width:28px}.generate-customize-control--popover .components-color-picker{box-sizing:border-box}.generate-customize-control--popover .components-color-picker__inputs-wrapper{display:none}.generate-customize-control--popover>.components-base-control:first-child{margin-bottom:0}.generate-customize-control--popover .components-color-picker__inputs-wrapper{min-width:auto}.generate-customize-control--popover .components-color-picker{padding:5px}.generate-customize-control--popover .components-color-picker__body{padding-bottom:0}.generate-customize-control--popover .components-color-clear-color{height:auto}.generate-component-color-picker[data-x-axis=left] .components-popover__content{margin-right:-35px!important}.generate-color-input--icon{align-items:center;border:1px solid;border-bottom-left-radius:3px;border-right:0;border-top-left-radius:3px;display:flex;justify-content:center;padding:5px}.generate-color-input--icon svg{height:1em;transform:scale(1.3);width:1em}.generate-color-option-area{padding:16px 0 0}.generate-color-input--css-var-name-wrapper{position:relative}.generate-color-input--css-var-name-wrapper button{bottom:0;height:auto;min-height:30px;padding:0 8px;position:absolute;right:0}.generate-color-input--css-var-name-wrapper button svg{fill:none;height:1em;width:1em}
|
||||
.generate-font-manager--item{margin-bottom:10px}.generate-font-manager--item .generate-font-manager--header{align-items:center;display:flex}.generate-font-manager--item .generate-font-manager--header .generate-font-manager--label{flex-grow:1;overflow:hidden;padding-left:0;text-overflow:ellipsis;white-space:nowrap}.generate-font-manager--item .generate-font-manager--header .components-button:not(.generate-font-manager--label){align-items:center;background:#fff;border:1px solid #777;border-radius:100%;display:flex;flex-shrink:0;height:30px;justify-content:center;margin-left:5px;min-width:30px;padding:0;width:30px}.generate-font-manager--item .generate-font-manager--header .components-button:not(.generate-font-manager--label) svg{height:1em;margin-right:0;width:1em}.generate-font-manager--item .generate-font-manager--header .components-button:not(.generate-font-manager--label).generate-font-manager--open svg{fill:none}.generate-font-manager--item .generate-font-manager--options{margin-top:15px}.generate-font-manager--item .generate-font-manager--footer{border-top:1px solid #ddd;margin-top:15px;padding-top:15px}.generate-font-manager--item .generate-font-manager-google-font--field{margin-top:10px}.generate-font-manager--item .generate-font-manager--google-font-options{display:flex;flex-wrap:wrap;margin-top:15px}.generate-font-manager--item .generate-font-manager--google-font-options>div{flex-basis:calc(50% - 10px);margin-bottom:0}.generate-font-manager--item .generate-font-manager--google-font-options>div:nth-child(2n){margin-left:5px}.generate-font-manager--item .generate-font-manager--google-font-options>div:nth-child(odd){margin-right:5px}.generate-font-manager--item .generate-font-manager--google-font-options .components-base-control__field{margin-bottom:0!important}.generate-font-manager--item .generate-font-manager--select-options{display:flex;flex-wrap:wrap}.generate-font-manager--item .generate-font-manager--select-options>div{flex-basis:calc(50% - 5px)}.generate-font-manager--item .generate-font-manager--select-options>div:nth-child(2n){margin-left:5px}.generate-font-manager--item .generate-font-manager--select-options>div:nth-child(odd){margin-right:5px}.generate-font-manager--item .components-select-control__input--generate-fontfamily{margin-bottom:3px}.generate-font-manager--item .generate-advanced-select__menu{position:relative!important}.generate-font-manager-group{margin-bottom:20px;margin-top:10px}.generate-font-manager-group__label{color:#000;font-size:11px;margin-bottom:10px;margin-top:0;text-transform:uppercase}.generate-font-manager-group .generate-font-manager--item:last-child{margin-bottom:0}.generate-customize-control--font-dropdown{background:#fff;margin-top:10px;padding:15px;position:relative}.generate-customize-control--font-dropdown:before{border-color:transparent transparent #fff;border-style:solid;border-width:0 10px 10px;content:"";height:0;left:11px;position:absolute;top:-10px;width:0;z-index:10}.generate-customize-control--font-dropdown>.components-base-control:not(:last-child){margin-bottom:15px}.generate-customize-control--font-dropdown>.components-base-control:last-child .components-base-control__field{margin-bottom:0}
|
||||
.generate-advanced-select__control{margin-bottom:12px}.generate-advanced-select__value-container{padding:0 6px!important}.generate-advanced-select__value-container>div{margin:0;padding:0}.generate-advanced-select__input input[type=text]:focus{box-shadow:none}.generate-advanced-select__option--is-selected{color:hsla(0,0%,100%,.5)!important}
|
||||
.components-generate-units-control-header__units{align-items:center;display:flex;justify-content:space-between;margin-bottom:5px}.components-generate-control__units .components-generate-control-buttons__units button.components-button{background:#fff;border:0;border-radius:0!important;box-shadow:none!important;color:#929da7;font-size:10px;height:auto;line-height:20px;padding:0 5px;position:relative;text-align:center;text-shadow:none}.components-generate-control__units .components-generate-control-buttons__units button.components-button.is-primary{background:#fff!important;color:#000!important;cursor:default;font-weight:700;z-index:1}.generate-component-device-field[data-device=desktop],.generate-component-device-field[data-device=mobile],.generate-component-device-field[data-device=tablet]{display:none}.preview-desktop .generate-component-device-field[data-device=desktop]{display:block}.preview-desktop .components-generate-control__units button.components-generate-control-button__units--desktop{color:#000}.preview-tablet .generate-component-device-field[data-device=tablet]{display:block}.preview-tablet .components-generate-control__units button.components-generate-control-button__units--tablet{color:#000}.preview-mobile .generate-component-device-field[data-device=mobile]{display:block}.preview-mobile .components-generate-control__units button.components-generate-control-button__units--mobile{color:#000}
|
||||
.gblocks-unit-control__disabled .gblocks-unit-control__input>.components-base-control{opacity:.5}.gblocks-unit-control__override-action{align-items:center;display:flex}.gblocks-unit-control__override-action button.components-button{height:20px;justify-content:center!important;min-width:20px;padding:0;width:20px}.gblocks-unit-control__override-action button.components-button.is-primary:focus:not(.disabled){box-shadow:0 0 0}.gblocks-unit-control__override-action button.components-button svg{margin:0!important;width:15px}.gblocks-unit-control__input{align-items:flex-start;display:flex;position:relative}.gblocks-unit-control__input .components-base-control:first-child{flex-grow:1}.gblocks-unit-control__input .components-base-control,.gblocks-unit-control__input .components-base-control__field{margin-bottom:0}.gblocks-unit-control__input--action{bottom:0;display:flex;gap:3px;position:absolute;right:5px;top:0}.gblocks-unit-control__input .gblocks-unit-control-units{align-items:center;display:flex;justify-content:center}.gblocks-unit-control__input .gblocks-unit-control-units button{align-items:center;border:1px solid rgba(0,0,0,.1);display:flex;font-size:10px;height:20px;justify-content:center;min-width:20px;padding:0 3px;width:auto}.gblocks-unit-control__input .gblocks-unit-control-units button:disabled{pointer-events:none}.gblocks-unit-control__input .gblocks-unit-control-units button.is-opened,.gblocks-unit-control__input .gblocks-unit-control-units button:hover{border-color:currentColor}.gblocks-unit-control__input .gblocks-unit-control-units button.is-opened{background:var(--wp-components-color-accent,var(--wp-admin-theme-color,#007cba));color:var(--wp-components-color-accent-inverted,#fff)}.gblocks-unit-control-popover .components-menu-group>div[role=group]{-ms-grid-columns:(1fr)[4];display:-ms-grid;display:grid;grid-template-columns:repeat(4,1fr)}.gblocks-unit-control-popover .components-menu-group>div[role=group] button{display:flex;justify-content:center;min-height:auto}.gblocks-unit-control-popover .components-menu-group>div[role=group] button .components-menu-item__item{font-size:11px;margin:0;min-width:auto}
|
||||
.generate-color-manager-dnd-list{border:1px dashed #959595;display:flex;flex-wrap:wrap;padding:10px 5px 5px}.generate-color-manager-dnd-list .generate-color-manager-dnd-list-item{border-radius:50%;cursor:grab;display:inline-block;height:28px;margin:0 5px 5px 0;position:relative;vertical-align:top;width:28px}.generate-color-manager-dnd-list .generate-color-manager-dnd-list-item:before{background:url("data:image/svg+xml;charset=utf-8,%3Csvg width=%2728%27 height=%2728%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath d=%27M6 8V6H4v2h2zm2 0V6h2v2H8zm2 8H8v-2h2v2zm2 0v-2h2v2h-2zm0 2v-2h-2v2H8v2h2v-2h2zm2 0v2h-2v-2h2zm2 0h-2v-2h2v2z%27 fill=%27%23555D65%27/%3E%3Cpath fill-rule=%27evenodd%27 clip-rule=%27evenodd%27 d=%27M18 18h2v-2h-2v-2h2v-2h-2v-2h2V8h-2v2h-2V8h-2v2h2v2h-2v2h2v2h2v2zm-2-4v-2h2v2h-2z%27 fill=%27%23555D65%27/%3E%3Cpath d=%27M18 18v2h-2v-2h2z%27 fill=%27%23555D65%27/%3E%3Cpath fill-rule=%27evenodd%27 clip-rule=%27evenodd%27 d=%27M8 10V8H6v2H4v2h2v2H4v2h2v2H4v2h2v2H4v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2V8h-2V6h2V4h-2v2h-2V4h-2v2h-2V4h-2v2h-2V4h-2v2h2v2h-2v2H8zm0 2v-2H6v2h2zm2 0v-2h2v2h-2zm0 2v-2H8v2H6v2h2v2H6v2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2V8h-2V6h-2v2h-2V6h-2v2h-2v2h2v2h-2v2h-2z%27 fill=%27%23555D65%27/%3E%3Cpath fill-rule=%27evenodd%27 clip-rule=%27evenodd%27 d=%27M4 0H2v2H0v2h2v2H0v2h2v2H0v2h2v2H0v2h2v2H0v2h2v2H0v2h2v2H0v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2V8h-2V6h2V4h-2V2h2V0h-2v2h-2V0h-2v2h-2V0h-2v2h-2V0h-2v2h-2V0h-2v2H8V0H6v2H4V0zm0 4V2H2v2h2zm2 0V2h2v2H6zm0 2V4H4v2H2v2h2v2H2v2h2v2H2v2h2v2H2v2h2v2H2v2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h2v2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2v-2h-2v-2h2V8h-2V6h2V4h-2V2h-2v2h-2V2h-2v2h-2V2h-2v2h-2V2h-2v2H8v2H6z%27 fill=%27%23555D65%27/%3E%3C/svg%3E");border-radius:50%;bottom:1px;content:"";left:1px;position:absolute;right:1px;top:1px;z-index:-1}.generate-color-manager-dnd-list .generate-color-manager-dnd-list-item span{border-radius:50%;display:block;height:28px;position:relative;width:28px}.generate-color-manager-dnd-list .generate-color-manager-dnd-list-item span:after{border:1px solid transparent;border-radius:50%;bottom:-1px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);content:"";left:-1px;position:absolute;right:-1px;top:-1px}.generate-color-manager-wrapper{display:flex;flex-wrap:wrap}.generate-color-manager-wrapper .generate-color-manager--item{margin-bottom:5px;margin-right:5px;position:relative}.generate-color-manager-wrapper .generate-color-manager--item:last-child{margin-right:0}.generate-color-manager-wrapper .generate-color-manager--item .components-button.generate-color-manager--delete-color{background:rgba(0,0,0,.7);border-radius:100%;color:#fff;height:auto;min-width:0;opacity:0;padding:2px;pointer-events:none;position:absolute;right:-10px;top:-10px;transition:opacity .5s ease}.generate-color-manager-wrapper .generate-color-manager--item .components-button.generate-color-manager--delete-color svg{height:15px;margin-right:0!important;width:15px}.generate-color-manager-wrapper .generate-color-manager--item .components-button.generate-color-manager--delete-color:focus,.generate-color-manager-wrapper .generate-color-manager--item:hover .components-button.generate-color-manager--delete-color{opacity:1;pointer-events:auto}.generate-color-manager-wrapper .generate-color-manager--item .components-circular-option-picker__option-wrapper{margin:0}.generate-color-manager-wrapper .generate-color-manager--item .components-button.generate-color-manager--add-color{align-items:center;background:#fff;border:1px solid #777;border-radius:100%;display:flex;height:28px;justify-content:center;padding:0;width:28px}.generate-color-manager-wrapper .generate-color-manager--item .components-button.generate-color-manager--add-color svg{width:20px}
|
||||
.generate-customize-control-title{display:flex;justify-content:space-between}.generate-customize-control-title button.generate-customize-control-title--label{font-size:14px;font-weight:500;height:auto;padding:0}.generate-customize-control-title button.generate-customize-control-title--toggle{align-items:center;background:#fff;border:1px solid #777;border-radius:100%;display:flex;height:28px;justify-content:center;padding:0;width:28px}.generate-customize-control-title button.generate-customize-control-title--toggle svg{fill:none;height:1em;width:1em}.generate-customize-control-title h3{font-size:14px!important;font-weight:500;margin-bottom:0}
|
@ -1,4 +0,0 @@
|
||||
.generate-dashboard-page .wrap{margin-right:0}.generate-dashboard-page #wpcontent{padding-left:0}.generate-dashboard-page .update-nag{margin-bottom:20px;margin-left:22px}.generate-dashboard-page.edit-php #wpbody-content .wrap{margin:0;padding:0 20px}.generatepress-dashboard-header{align-items:center;background:#fff;border-bottom:1px solid #e2e4e7;display:flex;justify-content:space-between;padding:0 20px;text-align:center}.generatepress-dashboard-header h1{align-items:center;display:flex;font-size:17px;font-weight:600;padding-bottom:0}.generatepress-dashboard-header h1 svg{fill:#006eb7;height:1em;padding-right:10px;width:1em}.generatepress-dashboard-header__navigation{background:#fff;display:flex}.generatepress-dashboard-header__navigation a{align-items:center;color:inherit;display:flex;padding:1rem;text-decoration:none}.generatepress-dashboard-header__navigation a.active{box-shadow:inset 0 -3px #007cba;font-weight:600}.generatepress-dashboard{font-size:15px;margin:40px auto;max-width:1000px}.generatepress-dashboard h2{font-size:25px;line-height:1.2em;margin:0}.generatepress-dashboard__placeholder.components-placeholder{background:none;box-shadow:none;margin-bottom:50px;outline:none;padding:0}.generatepress-dashboard__section-title{align-items:center;display:flex;margin-bottom:15px}.generatepress-dashboard__section-title>h2:first-child:not(:last-child){margin-right:10px}.generatepress-dashboard__section-description{margin-bottom:20px;margin-top:-10px}.generatepress-dashboard__section-description p{font-size:15px;margin:0}.generatepress-dashboard__section{color:#555;margin-bottom:50px}.generatepress-dashboard__section-item{align-items:center;background:#fff;display:flex;justify-content:space-between;padding:20px}.generatepress-dashboard__section-item:not(:last-child){border-bottom:1px solid #ddd}.generatepress-dashboard__section-item-title{font-weight:600}.generatepress-dashboard__section-item-action{align-items:center;display:flex;padding-left:20px}.generatepress-dashboard__section-item-action>:not(:last-child){margin-right:10px}.generatepress-dashboard__section-item-action .is-primary .components-spinner{background:rgba(0,0,0,.1);border-radius:100%;margin-top:0}.generatepress-dashboard__section-item-description{color:#80879a;font-size:13px;margin-top:3px}.generatepress-dashboard__section-item-message{background:#fafafa;border-radius:3px;box-shadow:1px 1px 1px rgba(0,0,0,.05);color:#555;display:none;font-size:12px;padding:5px 10px}.generatepress-dashboard__section-item-message__show{color:green;display:inline}.generatepress-dashboard__section-item-message__error{color:red}.generatepress-dashboard__reset-button.is-primary{background-color:#e02a2a}.generatepress-dashboard__reset-button.is-primary:hover:not(:disabled){background-color:darkred}@media(max-width:768px){.generatepress-dashboard-header{flex-direction:column}.generatepress-dashboard{padding-left:20px;padding-right:20px}}
|
||||
.generatepress-start-customizing{color:#555;display:flex;flex-wrap:wrap;margin-left:-30px}.generatepress-start-customizing__item{background:#fff;box-shadow:0 0 2px rgba(0,0,0,.1);box-sizing:border-box;margin-bottom:30px;margin-left:30px;padding:30px;width:calc(50% - 30px)}.generatepress-start-customizing__icon{align-items:center;background:#1e72bd;border-radius:100%;color:#fff;display:flex;height:50px;justify-content:center;margin-bottom:25px;width:50px}.generatepress-start-customizing__title{font-weight:500;margin-bottom:1em}.generatepress-start-customizing__description{font-weight:300;line-height:1.5em;margin-bottom:1em}.generatepress-start-customizing__action{margin-top:auto}.generatepress-start-customizing__pro{background:#f0544f;border-radius:2px;color:#fff;display:inline-block;font-size:11px;margin-left:5px;padding:0 5px}
|
||||
.generatepress-dashboard__premium{color:#555;display:flex;flex-wrap:wrap;margin-left:-30px}.generatepress-dashboard__premium-item{background:#fff;box-shadow:0 0 2px rgba(0,0,0,.1);box-sizing:border-box;flex-grow:1;margin-bottom:30px;margin-left:30px;padding:30px;width:calc(50% - 30px)}.generatepress-dashboard__premium-item-icon{align-items:center;background:#1e72bd;border-radius:100%;color:#fff;display:flex;height:50px;justify-content:center;margin-bottom:25px;width:50px}.generatepress-dashboard__premium-item-icon svg{height:25px;width:25px}.generatepress-dashboard__premium-item-title{align-items:center;display:flex;font-size:17px;font-weight:500;margin-bottom:10px}.generatepress-dashboard__premium-item-description{font-weight:300;line-height:1.5em;margin-bottom:1em}.generatepress-dashboard__premium-item-action{margin-top:auto}.generatepress-dashboard__premium-item-pro{background:#f0544f;border-radius:2px;color:#fff;display:inline-block;font-size:11px;margin-left:5px;padding:0 5px}
|
||||
.generatepress-dashboard__section-item-modules{margin-top:20px}
|
Before Width: | Height: | Size: 434 KiB |
@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Generated by IcoMoon</metadata>
|
||||
<defs>
|
||||
<font id="GeneratePress" horiz-adv-x="1024">
|
||||
<font-face units-per-em="1024" ascent="896" descent="-128" />
|
||||
<missing-glyph horiz-adv-x="1024" />
|
||||
<glyph unicode=" " horiz-adv-x="512" d="" />
|
||||
<glyph unicode="" glyph-name="search" d="M416 800c-176.732 0-320-143.268-320-320s143.268-320 320-320c176.732 0 320 143.268 320 320s-143.268 320-320 320zM0 480c0 229.75 186.25 416 416 416s416-186.25 416-416c0-97.482-33.53-187.132-89.686-258.048l267.652-268.036c18.732-18.758 18.71-49.15-0.050-67.882-18.758-18.732-49.15-18.71-67.882 0.050l-267.558 267.942c-70.982-56.36-160.798-90.026-258.476-90.026-229.75 0-416 186.25-416 416z" />
|
||||
<glyph unicode="" glyph-name="times" d="M142.058 753.942c18.746 18.744 49.138 18.744 67.884 0l302.058-302.060 302.058 302.060c18.746 18.744 49.138 18.744 67.884 0 18.744-18.746 18.744-49.138 0-67.884l-302.060-302.058 302.060-302.058c18.744-18.746 18.744-49.138 0-67.884-18.746-18.744-49.138-18.744-67.884 0l-302.058 302.060-302.058-302.060c-18.746-18.744-49.138-18.744-67.884 0-18.744 18.746-18.744 49.138 0 67.884l302.060 302.058-302.060 302.058c-18.744 18.746-18.744 49.138 0 67.884z" />
|
||||
<glyph unicode="" glyph-name="tags" d="M40 817c-17.672 0-32-14.326-32-32v-352c0-8.486 3.372-16.626 9.374-22.628l448-448c12.496-12.496 32.756-12.496 45.252 0l352 352c12.488 12.488 12.5 32.728 0.026 45.23l-447 448c-6.002 6.016-14.152 9.398-22.652 9.398h-353zM152 625c0 26.51 21.49 48 48 48s48-21.49 48-48c0-26.51-21.49-48-48-48s-48 21.49-48 48zM519.030 809.97c9.372 9.374 24.568 9.374 33.94 0l456-456c9.372-9.372 9.372-24.568 0-33.94l-360-360c-9.372-9.374-24.568-9.374-33.94 0-9.372 9.372-9.372 24.568 0 33.94l343.028 343.030-439.028 439.030c-9.372 9.372-9.372 24.568 0 33.94z" />
|
||||
<glyph unicode="" glyph-name="folder" d="M0 672c0 53.020 42.98 96 96 96h220.028c37.462 0 71.502-21.792 87.184-55.814l24.698-53.582c5.228-11.34 16.574-18.604 29.062-18.604h471.028c53.020 0 96-42.98 96-96v-448c0-53.020-42.98-96-96-96h-832c-53.020 0-96 42.98-96 96v576z" />
|
||||
<glyph unicode="" glyph-name="comments" d="M265.676 236.054c11.374 5.805 22.622 11.82 33.537 18.008 26.727 15.149 53.176 32.285 74.839 51.015 15.088-1.193 30.54-1.851 46.197-1.851 109.809 0 211.267 30.622 286.571 82.561 47.454 32.73 86.229 75.384 108.309 125.29 109.478-44.412 182.996-126.545 182.996-220.573 0-84.371-59.116-158.995-150.179-205.655 46.921-98.432 150.179-203.418 150.179-203.418s-231.674 76.701-308.848 156.918c-19.911-2.238-40.594-3.515-61.584-3.515-177.454 0-325.855 86.143-362.015 201.221zM766.742 630.996c0-141.206-165.922-255.575-370.433-255.575-20.991 0-41.674 1.278-61.584 3.515-77.174-80.187-308.848-156.859-308.848-156.859s103.258 104.944 150.179 203.341c-91.063 46.641-150.179 121.237-150.179 205.577 0 141.204 165.922 255.573 370.433 255.573s370.433-114.369 370.433-255.573z" />
|
||||
<glyph unicode="" glyph-name="bars" d="M0 704c0 26.51 21.49 48 48 48h928c26.51 0 48-21.49 48-48s-21.49-48-48-48h-928c-26.51 0-48 21.49-48 48zM0 384c0 26.51 21.49 48 48 48h928c26.51 0 48-21.49 48-48s-21.49-48-48-48h-928c-26.51 0-48 21.49-48 48zM0 64c0 26.51 21.49 48 48 48h928c26.51 0 48-21.49 48-48s-21.49-48-48-48h-928c-26.51 0-48 21.49-48 48z" />
|
||||
<glyph unicode="" glyph-name="angle-left" horiz-adv-x="384" d="M356.85 619.576c0-4.53-2.266-9.627-5.665-13.025l-222.633-222.554 222.633-222.554c3.399-3.398 5.665-8.494 5.665-13.025s-2.266-9.627-5.665-13.025l-28.325-28.315c-3.399-3.398-8.497-5.663-13.029-5.663s-9.63 2.265-13.029 5.663l-263.987 263.893c-3.399 3.398-5.665 8.494-5.665 13.025s2.266 9.627 5.665 13.025l263.987 263.893c3.399 3.398 8.497 5.663 13.029 5.663s9.63-2.265 13.029-5.663l28.325-28.315c3.399-3.398 5.665-7.928 5.665-13.025z" />
|
||||
<glyph unicode="" glyph-name="angle-right" horiz-adv-x="384" d="M356.85 383.998c0-4.532-2.266-9.63-5.665-13.029l-263.987-263.987c-3.399-3.399-8.497-5.665-13.029-5.665s-9.63 2.266-13.029 5.665l-28.325 28.325c-3.399 3.399-5.665 7.931-5.665 13.029 0 4.532 2.266 9.63 5.665 13.029l222.633 222.633-222.633 222.633c-3.399 3.399-5.665 8.497-5.665 13.029s2.266 9.63 5.665 13.029l28.325 28.325c3.399 3.399 8.497 5.665 13.029 5.665s9.63-2.266 13.029-5.665l263.987-263.987c3.399-3.399 5.665-8.497 5.665-13.029z" />
|
||||
<glyph unicode="" glyph-name="angle-up" horiz-adv-x="660" d="M611.725 266.169c0-4.532-2.265-9.63-5.663-13.029l-28.315-28.325c-3.398-3.399-7.928-5.665-13.025-5.665-4.53 0-9.627 2.266-13.025 5.665l-222.554 222.633-222.554-222.633c-3.398-3.399-8.494-5.665-13.025-5.665s-9.627 2.266-13.025 5.665l-28.315 28.325c-3.398 3.399-5.663 8.497-5.663 13.029s2.265 9.63 5.663 13.029l263.893 263.987c3.398 3.399 8.494 5.665 13.025 5.665s9.627-2.266 13.025-5.665l263.893-263.987c3.398-3.399 5.663-8.497 5.663-13.029z" />
|
||||
<glyph unicode="" glyph-name="angle-down" horiz-adv-x="660" d="M611.825 501.831c0-4.532-2.266-9.63-5.665-13.029l-263.987-263.987c-3.399-3.399-8.497-5.665-13.029-5.665s-9.63 2.266-13.029 5.665l-263.987 263.987c-3.399 3.399-5.665 8.497-5.665 13.029s2.266 9.63 5.665 13.029l28.325 28.325c3.399 3.399 7.931 5.665 13.029 5.665 4.532 0 9.63-2.266 13.029-5.665l222.633-222.633 222.633 222.633c3.399 3.399 8.497 5.665 13.029 5.665s9.63-2.266 13.029-5.665l28.325-28.325c3.399-3.399 5.665-8.497 5.665-13.029z" />
|
||||
</font></defs></svg>
|
Before Width: | Height: | Size: 5.3 KiB |
@ -1,65 +0,0 @@
|
||||
( function() {
|
||||
'use strict';
|
||||
|
||||
// Feature Test
|
||||
if ( 'querySelector' in document && 'addEventListener' in window ) {
|
||||
var goTopBtn = document.querySelector( '.generate-back-to-top' );
|
||||
|
||||
var trackScroll = function() {
|
||||
var scrolled = window.pageYOffset;
|
||||
var coords = goTopBtn.getAttribute( 'data-start-scroll' );
|
||||
|
||||
if ( scrolled > coords ) {
|
||||
goTopBtn.classList.add( 'generate-back-to-top__show' );
|
||||
}
|
||||
|
||||
if ( scrolled < coords ) {
|
||||
goTopBtn.classList.remove( 'generate-back-to-top__show' );
|
||||
}
|
||||
};
|
||||
|
||||
// Function to animate the scroll
|
||||
var smoothScroll = function( anchor, duration ) {
|
||||
// Calculate how far and how fast to scroll
|
||||
var startLocation = window.pageYOffset;
|
||||
var endLocation = document.body.offsetTop;
|
||||
var distance = endLocation - startLocation;
|
||||
var increments = distance / ( duration / 16 );
|
||||
var stopAnimation;
|
||||
|
||||
// Scroll the page by an increment, and check if it's time to stop
|
||||
var animateScroll = function() {
|
||||
window.scrollBy( 0, increments );
|
||||
stopAnimation();
|
||||
};
|
||||
|
||||
// Stop animation when you reach the anchor OR the top of the page
|
||||
stopAnimation = function() {
|
||||
var travelled = window.pageYOffset;
|
||||
if ( travelled <= ( endLocation || 0 ) ) {
|
||||
clearInterval( runAnimation );
|
||||
document.activeElement.blur();
|
||||
}
|
||||
};
|
||||
|
||||
// Loop the animation function
|
||||
var runAnimation = setInterval( animateScroll, 16 );
|
||||
};
|
||||
|
||||
if ( goTopBtn ) {
|
||||
// Show the button when scrolling down.
|
||||
window.addEventListener( 'scroll', trackScroll );
|
||||
|
||||
// Scroll back to top when clicked.
|
||||
goTopBtn.addEventListener( 'click', function( e ) {
|
||||
e.preventDefault();
|
||||
|
||||
if ( generatepressBackToTop.smooth ) {
|
||||
smoothScroll( document.body, goTopBtn.getAttribute( 'data-scroll-speed' ) || 400 );
|
||||
} else {
|
||||
window.scrollTo( 0, 0 );
|
||||
}
|
||||
}, false );
|
||||
}
|
||||
}
|
||||
}() );
|
@ -1 +0,0 @@
|
||||
!function(){"use strict";var c;"querySelector"in document&&"addEventListener"in window&&(c=document.querySelector(".generate-back-to-top"),c)&&(window.addEventListener("scroll",function(){var e=window.pageYOffset,t=c.getAttribute("data-start-scroll");t<e&&c.classList.add("generate-back-to-top__show"),e<t&&c.classList.remove("generate-back-to-top__show")}),c.addEventListener("click",function(e){var t,o,n,a,r;e.preventDefault(),generatepressBackToTop.smooth?(document.body,e=c.getAttribute("data-scroll-speed")||400,t=window.pageYOffset,o=document.body.offsetTop,n=(o-t)/(e/16),a=function(){window.pageYOffset<=(o||0)&&(clearInterval(r),document.activeElement.blur())},r=setInterval(function(){window.scrollBy(0,n),a()},16)):window.scrollTo(0,0)},!1))}();
|
@ -1,240 +0,0 @@
|
||||
/*
|
||||
* classList.js: Cross-browser full element.classList implementation.
|
||||
* 1.1.20170427
|
||||
*
|
||||
* By Eli Grey, http://eligrey.com
|
||||
* License: Dedicated to the public domain.
|
||||
* See https://github.com/eligrey/classList.js/blob/master/LICENSE.md
|
||||
*/
|
||||
|
||||
/*global self, document, DOMException */
|
||||
|
||||
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
|
||||
|
||||
if ("document" in self) {
|
||||
|
||||
// Full polyfill for browsers with no classList support
|
||||
// Including IE < Edge missing SVGElement.classList
|
||||
if (!("classList" in document.createElement("_"))
|
||||
|| document.createElementNS && !("classList" in document.createElementNS("http://www.w3.org/2000/svg","g"))) {
|
||||
|
||||
(function (view) {
|
||||
|
||||
"use strict";
|
||||
|
||||
if (!('Element' in view)) return;
|
||||
|
||||
var
|
||||
classListProp = "classList"
|
||||
, protoProp = "prototype"
|
||||
, elemCtrProto = view.Element[protoProp]
|
||||
, objCtr = Object
|
||||
, strTrim = String[protoProp].trim || function () {
|
||||
return this.replace(/^\s+|\s+$/g, "");
|
||||
}
|
||||
, arrIndexOf = Array[protoProp].indexOf || function (item) {
|
||||
var
|
||||
i = 0
|
||||
, len = this.length
|
||||
;
|
||||
for (; i < len; i++) {
|
||||
if (i in this && this[i] === item) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
// Vendors: please allow content code to instantiate DOMExceptions
|
||||
, DOMEx = function (type, message) {
|
||||
this.name = type;
|
||||
this.code = DOMException[type];
|
||||
this.message = message;
|
||||
}
|
||||
, checkTokenAndGetIndex = function (classList, token) {
|
||||
if (token === "") {
|
||||
throw new DOMEx(
|
||||
"SYNTAX_ERR"
|
||||
, "An invalid or illegal string was specified"
|
||||
);
|
||||
}
|
||||
if (/\s/.test(token)) {
|
||||
throw new DOMEx(
|
||||
"INVALID_CHARACTER_ERR"
|
||||
, "String contains an invalid character"
|
||||
);
|
||||
}
|
||||
return arrIndexOf.call(classList, token);
|
||||
}
|
||||
, ClassList = function (elem) {
|
||||
var
|
||||
trimmedClasses = strTrim.call(elem.getAttribute("class") || "")
|
||||
, classes = trimmedClasses ? trimmedClasses.split(/\s+/) : []
|
||||
, i = 0
|
||||
, len = classes.length
|
||||
;
|
||||
for (; i < len; i++) {
|
||||
this.push(classes[i]);
|
||||
}
|
||||
this._updateClassName = function () {
|
||||
elem.setAttribute("class", this.toString());
|
||||
};
|
||||
}
|
||||
, classListProto = ClassList[protoProp] = []
|
||||
, classListGetter = function () {
|
||||
return new ClassList(this);
|
||||
}
|
||||
;
|
||||
// Most DOMException implementations don't allow calling DOMException's toString()
|
||||
// on non-DOMExceptions. Error's toString() is sufficient here.
|
||||
DOMEx[protoProp] = Error[protoProp];
|
||||
classListProto.item = function (i) {
|
||||
return this[i] || null;
|
||||
};
|
||||
classListProto.contains = function (token) {
|
||||
token += "";
|
||||
return checkTokenAndGetIndex(this, token) !== -1;
|
||||
};
|
||||
classListProto.add = function () {
|
||||
var
|
||||
tokens = arguments
|
||||
, i = 0
|
||||
, l = tokens.length
|
||||
, token
|
||||
, updated = false
|
||||
;
|
||||
do {
|
||||
token = tokens[i] + "";
|
||||
if (checkTokenAndGetIndex(this, token) === -1) {
|
||||
this.push(token);
|
||||
updated = true;
|
||||
}
|
||||
}
|
||||
while (++i < l);
|
||||
|
||||
if (updated) {
|
||||
this._updateClassName();
|
||||
}
|
||||
};
|
||||
classListProto.remove = function () {
|
||||
var
|
||||
tokens = arguments
|
||||
, i = 0
|
||||
, l = tokens.length
|
||||
, token
|
||||
, updated = false
|
||||
, index
|
||||
;
|
||||
do {
|
||||
token = tokens[i] + "";
|
||||
index = checkTokenAndGetIndex(this, token);
|
||||
while (index !== -1) {
|
||||
this.splice(index, 1);
|
||||
updated = true;
|
||||
index = checkTokenAndGetIndex(this, token);
|
||||
}
|
||||
}
|
||||
while (++i < l);
|
||||
|
||||
if (updated) {
|
||||
this._updateClassName();
|
||||
}
|
||||
};
|
||||
classListProto.toggle = function (token, force) {
|
||||
token += "";
|
||||
|
||||
var
|
||||
result = this.contains(token)
|
||||
, method = result ?
|
||||
force !== true && "remove"
|
||||
:
|
||||
force !== false && "add"
|
||||
;
|
||||
|
||||
if (method) {
|
||||
this[method](token);
|
||||
}
|
||||
|
||||
if (force === true || force === false) {
|
||||
return force;
|
||||
} else {
|
||||
return !result;
|
||||
}
|
||||
};
|
||||
classListProto.toString = function () {
|
||||
return this.join(" ");
|
||||
};
|
||||
|
||||
if (objCtr.defineProperty) {
|
||||
var classListPropDesc = {
|
||||
get: classListGetter
|
||||
, enumerable: true
|
||||
, configurable: true
|
||||
};
|
||||
try {
|
||||
objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
|
||||
} catch (ex) { // IE 8 doesn't support enumerable:true
|
||||
// adding undefined to fight this issue https://github.com/eligrey/classList.js/issues/36
|
||||
// modernie IE8-MSW7 machine has IE8 8.0.6001.18702 and is affected
|
||||
if (ex.number === undefined || ex.number === -0x7FF5EC54) {
|
||||
classListPropDesc.enumerable = false;
|
||||
objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
|
||||
}
|
||||
}
|
||||
} else if (objCtr[protoProp].__defineGetter__) {
|
||||
elemCtrProto.__defineGetter__(classListProp, classListGetter);
|
||||
}
|
||||
|
||||
}(self));
|
||||
|
||||
}
|
||||
|
||||
// There is full or partial native classList support, so just check if we need
|
||||
// to normalize the add/remove and toggle APIs.
|
||||
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
var testElement = document.createElement("_");
|
||||
|
||||
testElement.classList.add("c1", "c2");
|
||||
|
||||
// Polyfill for IE 10/11 and Firefox <26, where classList.add and
|
||||
// classList.remove exist but support only one argument at a time.
|
||||
if (!testElement.classList.contains("c2")) {
|
||||
var createMethod = function(method) {
|
||||
var original = DOMTokenList.prototype[method];
|
||||
|
||||
DOMTokenList.prototype[method] = function(token) {
|
||||
var i, len = arguments.length;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
token = arguments[i];
|
||||
original.call(this, token);
|
||||
}
|
||||
};
|
||||
};
|
||||
createMethod('add');
|
||||
createMethod('remove');
|
||||
}
|
||||
|
||||
testElement.classList.toggle("c3", false);
|
||||
|
||||
// Polyfill for IE 10 and Firefox <24, where classList.toggle does not
|
||||
// support the second argument.
|
||||
if (testElement.classList.contains("c3")) {
|
||||
var _toggle = DOMTokenList.prototype.toggle;
|
||||
|
||||
DOMTokenList.prototype.toggle = function(token, force) {
|
||||
if (1 in arguments && !this.contains(token) === !force) {
|
||||
return force;
|
||||
} else {
|
||||
return _toggle.call(this, token);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
testElement = null;
|
||||
}());
|
||||
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
|
||||
"document"in self&&("classList"in document.createElement("_")&&(!document.createElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg","g"))||!function(t){"use strict";if("Element"in t){var e="classList",n="prototype",i=t.Element[n],s=Object,r=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},o=Array[n].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},a=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},c=function(t,e){if(""===e)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return o.call(t,e)},l=function(t){for(var e=r.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],i=0,s=n.length;s>i;i++)this.push(n[i]);this._updateClassName=function(){t.setAttribute("class",""+this)}},u=l[n]=[],h=function(){return new l(this)};if(a[n]=Error[n],u.item=function(t){return this[t]||null},u.contains=function(t){return t+="",-1!==c(this,t)},u.add=function(){var t,e=arguments,n=0,i=e.length,s=!1;do t=e[n]+"",-1===c(this,t)&&(this.push(t),s=!0);while(++n<i);s&&this._updateClassName()},u.remove=function(){var t,e,n=arguments,i=0,s=n.length,r=!1;do for(t=n[i]+"",e=c(this,t);-1!==e;)this.splice(e,1),r=!0,e=c(this,t);while(++i<s);r&&this._updateClassName()},u.toggle=function(t,e){t+="";var n=this.contains(t),i=n?e!==!0&&"remove":e!==!1&&"add";return i&&this[i](t),e===!0||e===!1?e:!n},u.toString=function(){return this.join(" ")},s.defineProperty){var f={get:h,enumerable:!0,configurable:!0};try{s.defineProperty(i,e,f)}catch(g){(void 0===g.number||-2146823252===g.number)&&(f.enumerable=!1,s.defineProperty(i,e,f))}}else s[n].__defineGetter__&&i.__defineGetter__(e,h)}}(self),function(){"use strict";var t=document.createElement("_");if(t.classList.add("c1","c2"),!t.classList.contains("c2")){var e=function(t){var e=DOMTokenList.prototype[t];DOMTokenList.prototype[t]=function(t){var n,i=arguments.length;for(n=0;i>n;n++)t=arguments[n],e.call(this,t)}};e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==!e?e:n.call(this,t)}}t=null}());
|
@ -1,123 +0,0 @@
|
||||
( function() {
|
||||
'use strict';
|
||||
|
||||
if ( 'querySelector' in document && 'addEventListener' in window ) {
|
||||
var body = document.body,
|
||||
i;
|
||||
/**
|
||||
* Dropdown click
|
||||
*
|
||||
* @param {Object} e The event.
|
||||
* @param {Object} _this The clicked item.
|
||||
*/
|
||||
var dropdownClick = function( e, _this ) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
if ( ! _this ) {
|
||||
_this = this;
|
||||
}
|
||||
|
||||
var closestLi = _this.closest( 'li' );
|
||||
|
||||
// Close other sub-menus
|
||||
var openedSubMenus = _this.closest( 'nav' ).querySelectorAll( 'ul.toggled-on' );
|
||||
if ( openedSubMenus && ! _this.closest( 'ul' ).classList.contains( 'toggled-on' ) && ! _this.closest( 'li' ).classList.contains( 'sfHover' ) ) {
|
||||
for ( var o = 0; o < openedSubMenus.length; o++ ) {
|
||||
openedSubMenus[ o ].classList.remove( 'toggled-on' );
|
||||
openedSubMenus[ o ].closest( 'li' ).classList.remove( 'sfHover' );
|
||||
}
|
||||
}
|
||||
|
||||
// Add sfHover class to parent li
|
||||
closestLi.classList.toggle( 'sfHover' );
|
||||
|
||||
// Set aria-expanded on arrow
|
||||
var dropdownToggle = closestLi.querySelector( '.dropdown-menu-toggle' );
|
||||
if ( 'false' === dropdownToggle.getAttribute( 'aria-expanded' ) || ! dropdownToggle.getAttribute( 'aria-expanded' ) ) {
|
||||
dropdownToggle.setAttribute( 'aria-expanded', 'true' );
|
||||
} else {
|
||||
dropdownToggle.setAttribute( 'aria-expanded', 'false' );
|
||||
}
|
||||
|
||||
if ( closestLi.querySelector( '.sub-menu' ) ) {
|
||||
var subMenuSelector = '.sub-menu';
|
||||
} else {
|
||||
subMenuSelector = '.children';
|
||||
}
|
||||
|
||||
// Open the sub-menu
|
||||
if ( body.classList.contains( 'dropdown-click-menu-item' ) ) {
|
||||
_this.parentNode.querySelector( subMenuSelector ).classList.toggle( 'toggled-on' );
|
||||
} else if ( body.classList.contains( 'dropdown-click-arrow' ) ) {
|
||||
closestLi.querySelector( subMenuSelector ).classList.toggle( 'toggled-on' );
|
||||
}
|
||||
};
|
||||
|
||||
// Do stuff if click dropdown if enabled
|
||||
var parentElementLinks = document.querySelectorAll( '.main-nav .menu-item-has-children > a' );
|
||||
|
||||
// Open the sub-menu by clicking on the entire link element
|
||||
if ( body.classList.contains( 'dropdown-click-menu-item' ) ) {
|
||||
for ( i = 0; i < parentElementLinks.length; i++ ) {
|
||||
parentElementLinks[ i ].addEventListener( 'click', dropdownClick, true );
|
||||
}
|
||||
}
|
||||
|
||||
// Open the sub-menu by clicking on a dropdown arrow
|
||||
if ( body.classList.contains( 'dropdown-click-arrow' ) ) {
|
||||
// Add a class to sub-menu items that are set to #
|
||||
for ( i = 0; i < document.querySelectorAll( '.main-nav .menu-item-has-children > a' ).length; i++ ) {
|
||||
if ( '#' === document.querySelectorAll( '.main-nav .menu-item-has-children > a' )[ i ].getAttribute( 'href' ) ) {
|
||||
document.querySelectorAll( '.main-nav .menu-item-has-children > a' )[ i ].classList.add( 'menu-item-dropdown-click' );
|
||||
}
|
||||
}
|
||||
|
||||
var dropdownToggleLinks = document.querySelectorAll( '.main-nav .menu-item-has-children > a .dropdown-menu-toggle' );
|
||||
for ( i = 0; i < dropdownToggleLinks.length; i++ ) {
|
||||
dropdownToggleLinks[ i ].addEventListener( 'click', dropdownClick, false );
|
||||
|
||||
dropdownToggleLinks[ i ].addEventListener( 'keydown', function( e ) {
|
||||
var _this = this;
|
||||
|
||||
if ( 'Enter' === e.key ) {
|
||||
dropdownClick( e, _this );
|
||||
}
|
||||
}, false );
|
||||
}
|
||||
|
||||
for ( i = 0; i < document.querySelectorAll( '.main-nav .menu-item-has-children > a.menu-item-dropdown-click' ).length; i++ ) {
|
||||
document.querySelectorAll( '.main-nav .menu-item-has-children > a.menu-item-dropdown-click' )[ i ].addEventListener( 'click', dropdownClick, false );
|
||||
}
|
||||
}
|
||||
|
||||
var closeSubMenus = function() {
|
||||
if ( document.querySelector( 'nav ul .toggled-on' ) ) {
|
||||
var activeSubMenus = document.querySelectorAll( 'nav ul .toggled-on' );
|
||||
var activeDropdownToggles = document.querySelectorAll( 'nav .dropdown-menu-toggle' );
|
||||
for ( i = 0; i < activeSubMenus.length; i++ ) {
|
||||
activeSubMenus[ i ].classList.remove( 'toggled-on' );
|
||||
activeSubMenus[ i ].closest( '.sfHover' ).classList.remove( 'sfHover' );
|
||||
}
|
||||
|
||||
for ( i = 0; i < activeDropdownToggles.length; i++ ) {
|
||||
activeDropdownToggles[ i ].setAttribute( 'aria-expanded', 'false' );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Close sub-menus when clicking elsewhere
|
||||
document.addEventListener( 'click', function( event ) {
|
||||
if ( ! event.target.closest( '.sfHover' ) ) {
|
||||
closeSubMenus();
|
||||
}
|
||||
}, false );
|
||||
|
||||
// Close sub-menus on escape key
|
||||
document.addEventListener( 'keydown', function( e ) {
|
||||
if ( 'Escape' === e.key ) { // 27 is esc
|
||||
closeSubMenus();
|
||||
}
|
||||
}, false );
|
||||
}
|
||||
}() );
|
@ -1 +0,0 @@
|
||||
!function(){"use strict";if("querySelector"in document&&"addEventListener"in window){var r=document.body,t=function(e,t){e.preventDefault(),e.stopPropagation();var e=(t=t||this).closest("li"),n=t.closest("nav").querySelectorAll("ul.toggled-on");if(n&&!t.closest("ul").classList.contains("toggled-on")&&!t.closest("li").classList.contains("sfHover"))for(var o=0;o<n.length;o++)n[o].classList.remove("toggled-on"),n[o].closest("li").classList.remove("sfHover");e.classList.toggle("sfHover");var l=e.querySelector(".dropdown-menu-toggle");"false"!==l.getAttribute("aria-expanded")&&l.getAttribute("aria-expanded")?l.setAttribute("aria-expanded","false"):l.setAttribute("aria-expanded","true"),l=e.querySelector(".sub-menu")?".sub-menu":".children",r.classList.contains("dropdown-click-menu-item")?t.parentNode.querySelector(l).classList.toggle("toggled-on"):r.classList.contains("dropdown-click-arrow")&&e.querySelector(l).classList.toggle("toggled-on")},e=document.querySelectorAll(".main-nav .menu-item-has-children > a");if(r.classList.contains("dropdown-click-menu-item"))for(o=0;o<e.length;o++)e[o].addEventListener("click",t,!0);if(r.classList.contains("dropdown-click-arrow")){for(o=0;o<document.querySelectorAll(".main-nav .menu-item-has-children > a").length;o++)"#"===document.querySelectorAll(".main-nav .menu-item-has-children > a")[o].getAttribute("href")&&document.querySelectorAll(".main-nav .menu-item-has-children > a")[o].classList.add("menu-item-dropdown-click");for(var n=document.querySelectorAll(".main-nav .menu-item-has-children > a .dropdown-menu-toggle"),o=0;o<n.length;o++)n[o].addEventListener("click",t,!1),n[o].addEventListener("keydown",function(e){"Enter"===e.key&&t(e,this)},!1);for(o=0;o<document.querySelectorAll(".main-nav .menu-item-has-children > a.menu-item-dropdown-click").length;o++)document.querySelectorAll(".main-nav .menu-item-has-children > a.menu-item-dropdown-click")[o].addEventListener("click",t,!1)}var l=function(){if(document.querySelector("nav ul .toggled-on")){var e=document.querySelectorAll("nav ul .toggled-on"),t=document.querySelectorAll("nav .dropdown-menu-toggle");for(o=0;o<e.length;o++)e[o].classList.remove("toggled-on"),e[o].closest(".sfHover").classList.remove("sfHover");for(o=0;o<t.length;o++)t[o].setAttribute("aria-expanded","false")}};document.addEventListener("click",function(e){e.target.closest(".sfHover")||l()},!1),document.addEventListener("keydown",function(e){"Escape"===e.key&&l()},!1)}}();
|
@ -1,415 +0,0 @@
|
||||
( function() {
|
||||
'use strict';
|
||||
|
||||
if ( 'querySelector' in document && 'addEventListener' in window ) {
|
||||
/**
|
||||
* matches() pollyfil
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Browser_compatibility
|
||||
*/
|
||||
if ( ! Element.prototype.matches ) {
|
||||
Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
|
||||
}
|
||||
|
||||
/**
|
||||
* closest() pollyfil
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Browser_compatibility
|
||||
* @param {Object} s The element to check.
|
||||
* @return {Object} The closest object.
|
||||
*/
|
||||
if ( ! Element.prototype.closest ) {
|
||||
Element.prototype.closest = function( s ) {
|
||||
var el = this;
|
||||
var ancestor = this;
|
||||
if ( ! document.documentElement.contains( el ) ) {
|
||||
return null;
|
||||
}
|
||||
do {
|
||||
if ( ancestor.matches( s ) ) {
|
||||
return ancestor;
|
||||
}
|
||||
ancestor = ancestor.parentElement;
|
||||
} while ( ancestor !== null );
|
||||
return null;
|
||||
};
|
||||
}
|
||||
|
||||
var getSiblings = function( elem ) {
|
||||
return Array.prototype.filter.call( elem.parentNode.children, function( sibling ) {
|
||||
return sibling !== elem;
|
||||
} );
|
||||
};
|
||||
|
||||
var allNavToggles = document.querySelectorAll( '.menu-toggle' ),
|
||||
dropdownToggles = document.querySelectorAll( 'nav .dropdown-menu-toggle' ),
|
||||
navLinks = document.querySelectorAll( 'nav .main-nav ul a' ),
|
||||
mobileMenuControls = document.querySelector( '.mobile-menu-control-wrapper' ),
|
||||
body = document.body,
|
||||
htmlEl = document.documentElement,
|
||||
i;
|
||||
|
||||
var enableDropdownArrows = function( nav ) {
|
||||
if ( nav && body.classList.contains( 'dropdown-hover' ) ) {
|
||||
var dropdownItems = nav.querySelectorAll( 'li.menu-item-has-children' );
|
||||
|
||||
for ( i = 0; i < dropdownItems.length; i++ ) {
|
||||
dropdownItems[ i ].querySelector( '.dropdown-menu-toggle' ).setAttribute( 'tabindex', '0' );
|
||||
dropdownItems[ i ].querySelector( '.dropdown-menu-toggle' ).setAttribute( 'role', 'button' );
|
||||
dropdownItems[ i ].querySelector( '.dropdown-menu-toggle' ).setAttribute( 'aria-expanded', 'false' );
|
||||
dropdownItems[ i ].querySelector( '.dropdown-menu-toggle' ).setAttribute( 'aria-label', generatepressMenu.openSubMenuLabel );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var disableDropdownArrows = function( nav ) {
|
||||
if ( nav && body.classList.contains( 'dropdown-hover' ) ) {
|
||||
var dropdownItems = nav.querySelectorAll( 'li.menu-item-has-children' );
|
||||
|
||||
for ( i = 0; i < dropdownItems.length; i++ ) {
|
||||
dropdownItems[ i ].querySelector( '.dropdown-menu-toggle' ).removeAttribute( 'tabindex' );
|
||||
dropdownItems[ i ].querySelector( '.dropdown-menu-toggle' ).setAttribute( 'role', 'presentation' );
|
||||
dropdownItems[ i ].querySelector( '.dropdown-menu-toggle' ).removeAttribute( 'aria-expanded' );
|
||||
dropdownItems[ i ].querySelector( '.dropdown-menu-toggle' ).removeAttribute( 'aria-label' );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var setDropdownArrowAttributes = function( arrow ) {
|
||||
if ( 'false' === arrow.getAttribute( 'aria-expanded' ) || ! arrow.getAttribute( 'aria-expanded' ) ) {
|
||||
arrow.setAttribute( 'aria-expanded', 'true' );
|
||||
arrow.setAttribute( 'aria-label', generatepressMenu.closeSubMenuLabel );
|
||||
} else {
|
||||
arrow.setAttribute( 'aria-expanded', 'false' );
|
||||
arrow.setAttribute( 'aria-label', generatepressMenu.openSubMenuLabel );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Start mobile menu toggle.
|
||||
*
|
||||
* @param {Object} e The event.
|
||||
* @param {Object} _this The clicked item.
|
||||
*/
|
||||
var toggleNav = function( e, _this ) {
|
||||
if ( ! _this ) {
|
||||
_this = this;
|
||||
}
|
||||
|
||||
var parentContainer = '';
|
||||
|
||||
if ( _this.getAttribute( 'data-nav' ) ) {
|
||||
parentContainer = document.getElementById( _this.getAttribute( 'data-nav' ) );
|
||||
} else {
|
||||
parentContainer = document.getElementById( _this.closest( 'nav' ).getAttribute( 'id' ) );
|
||||
}
|
||||
|
||||
if ( ! parentContainer ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var isExternalToggle = false;
|
||||
|
||||
if ( _this.closest( '.mobile-menu-control-wrapper' ) ) {
|
||||
isExternalToggle = true;
|
||||
}
|
||||
|
||||
var nav = parentContainer.getElementsByTagName( 'ul' )[ 0 ];
|
||||
|
||||
if ( parentContainer.classList.contains( 'toggled' ) ) {
|
||||
parentContainer.classList.remove( 'toggled' );
|
||||
htmlEl.classList.remove( 'mobile-menu-open' );
|
||||
|
||||
if ( nav ) {
|
||||
nav.setAttribute( 'aria-hidden', 'true' );
|
||||
}
|
||||
|
||||
_this.setAttribute( 'aria-expanded', 'false' );
|
||||
|
||||
if ( isExternalToggle ) {
|
||||
mobileMenuControls.classList.remove( 'toggled' );
|
||||
} else if ( mobileMenuControls && parentContainer.classList.contains( 'main-navigation' ) ) {
|
||||
mobileMenuControls.classList.remove( 'toggled' );
|
||||
}
|
||||
|
||||
disableDropdownArrows( nav );
|
||||
} else {
|
||||
parentContainer.classList.add( 'toggled' );
|
||||
htmlEl.classList.add( 'mobile-menu-open' );
|
||||
|
||||
if ( nav ) {
|
||||
nav.setAttribute( 'aria-hidden', 'false' );
|
||||
}
|
||||
|
||||
_this.setAttribute( 'aria-expanded', 'true' );
|
||||
|
||||
if ( isExternalToggle ) {
|
||||
mobileMenuControls.classList.add( 'toggled' );
|
||||
|
||||
if ( mobileMenuControls.querySelector( '.search-item' ) ) {
|
||||
if ( mobileMenuControls.querySelector( '.search-item' ).classList.contains( 'active' ) ) {
|
||||
mobileMenuControls.querySelector( '.search-item' ).click();
|
||||
}
|
||||
}
|
||||
} else if ( mobileMenuControls && parentContainer.classList.contains( 'main-navigation' ) ) {
|
||||
mobileMenuControls.classList.add( 'toggled' );
|
||||
}
|
||||
|
||||
enableDropdownArrows( nav );
|
||||
}
|
||||
};
|
||||
|
||||
for ( i = 0; i < allNavToggles.length; i++ ) {
|
||||
allNavToggles[ i ].addEventListener( 'click', toggleNav, false );
|
||||
}
|
||||
|
||||
/**
|
||||
* Open sub-menus
|
||||
*
|
||||
* @param {Object} e The event.
|
||||
* @param {Object} _this The clicked item.
|
||||
*/
|
||||
var toggleSubNav = function( e, _this ) {
|
||||
if ( ! _this ) {
|
||||
_this = this;
|
||||
}
|
||||
|
||||
if ( ( _this.closest( 'nav' ).classList.contains( 'toggled' ) || htmlEl.classList.contains( 'slide-opened' ) ) && ! body.classList.contains( 'dropdown-click' ) ) {
|
||||
e.preventDefault();
|
||||
var closestLi = _this.closest( 'li' );
|
||||
|
||||
setDropdownArrowAttributes( closestLi.querySelector( '.dropdown-menu-toggle' ) );
|
||||
|
||||
if ( closestLi.querySelector( '.sub-menu' ) ) {
|
||||
var subMenu = closestLi.querySelector( '.sub-menu' );
|
||||
} else {
|
||||
subMenu = closestLi.querySelector( '.children' );
|
||||
}
|
||||
|
||||
if ( generatepressMenu.toggleOpenedSubMenus ) {
|
||||
var siblings = getSiblings( closestLi );
|
||||
|
||||
for ( i = 0; i < siblings.length; i++ ) {
|
||||
if ( siblings[ i ].classList.contains( 'sfHover' ) ) {
|
||||
siblings[ i ].classList.remove( 'sfHover' );
|
||||
siblings[ i ].querySelector( '.toggled-on' ).classList.remove( 'toggled-on' );
|
||||
setDropdownArrowAttributes( siblings[ i ].querySelector( '.dropdown-menu-toggle' ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closestLi.classList.toggle( 'sfHover' );
|
||||
subMenu.classList.toggle( 'toggled-on' );
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
};
|
||||
|
||||
for ( i = 0; i < dropdownToggles.length; i++ ) {
|
||||
dropdownToggles[ i ].addEventListener( 'click', toggleSubNav, false );
|
||||
dropdownToggles[ i ].addEventListener( 'keypress', function( e ) {
|
||||
if ( 'Enter' === e.key || ' ' === e.key ) {
|
||||
toggleSubNav( e, this );
|
||||
}
|
||||
}, false );
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable the mobile menu if our toggle isn't visible.
|
||||
* Makes it possible to style mobile item with .toggled class.
|
||||
*/
|
||||
var checkMobile = function() {
|
||||
var openedMobileMenus = document.querySelectorAll( '.toggled, .has-active-search' );
|
||||
|
||||
for ( i = 0; i < openedMobileMenus.length; i++ ) {
|
||||
var menuToggle = openedMobileMenus[ i ].querySelector( '.menu-toggle' );
|
||||
|
||||
if ( mobileMenuControls && ! menuToggle.closest( 'nav' ).classList.contains( 'mobile-menu-control-wrapper' ) ) {
|
||||
menuToggle = mobileMenuControls.querySelector( '.menu-toggle' );
|
||||
}
|
||||
|
||||
if ( menuToggle && menuToggle.offsetParent === null ) {
|
||||
if ( openedMobileMenus[ i ].classList.contains( 'toggled' ) ) {
|
||||
var remoteNav = false;
|
||||
|
||||
if ( openedMobileMenus[ i ].classList.contains( 'mobile-menu-control-wrapper' ) ) {
|
||||
remoteNav = true;
|
||||
}
|
||||
|
||||
if ( ! remoteNav ) {
|
||||
// Navigation is toggled, but .menu-toggle isn't visible on the page (display: none).
|
||||
var closestNav = openedMobileMenus[ i ].getElementsByTagName( 'ul' )[ 0 ],
|
||||
closestNavItems = closestNav ? closestNav.getElementsByTagName( 'li' ) : [],
|
||||
closestSubMenus = closestNav ? closestNav.getElementsByTagName( 'ul' ) : [];
|
||||
}
|
||||
|
||||
document.activeElement.blur();
|
||||
openedMobileMenus[ i ].classList.remove( 'toggled' );
|
||||
|
||||
htmlEl.classList.remove( 'mobile-menu-open' );
|
||||
menuToggle.setAttribute( 'aria-expanded', 'false' );
|
||||
|
||||
if ( ! remoteNav ) {
|
||||
for ( var li = 0; li < closestNavItems.length; li++ ) {
|
||||
closestNavItems[ li ].classList.remove( 'sfHover' );
|
||||
}
|
||||
|
||||
for ( var sm = 0; sm < closestSubMenus.length; sm++ ) {
|
||||
closestSubMenus[ sm ].classList.remove( 'toggled-on' );
|
||||
}
|
||||
|
||||
if ( closestNav ) {
|
||||
closestNav.removeAttribute( 'aria-hidden' );
|
||||
}
|
||||
}
|
||||
|
||||
disableDropdownArrows( openedMobileMenus[ i ] );
|
||||
}
|
||||
|
||||
if ( mobileMenuControls.querySelector( '.search-item' ) ) {
|
||||
if ( mobileMenuControls.querySelector( '.search-item' ).classList.contains( 'active' ) ) {
|
||||
mobileMenuControls.querySelector( '.search-item' ).click();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
window.addEventListener( 'resize', checkMobile, false );
|
||||
window.addEventListener( 'orientationchange', checkMobile, false );
|
||||
|
||||
if ( body.classList.contains( 'dropdown-hover' ) ) {
|
||||
/**
|
||||
* Do some essential things when menu items are clicked.
|
||||
*/
|
||||
for ( i = 0; i < navLinks.length; i++ ) {
|
||||
navLinks[ i ].addEventListener( 'click', function( e ) {
|
||||
// Remove sfHover class if we're going to another site.
|
||||
if ( this.hostname !== window.location.hostname ) {
|
||||
document.activeElement.blur();
|
||||
}
|
||||
|
||||
var closestNav = this.closest( 'nav' );
|
||||
if ( closestNav.classList.contains( 'toggled' ) || htmlEl.classList.contains( 'slide-opened' ) ) {
|
||||
var url = this.getAttribute( 'href' );
|
||||
|
||||
// Open the sub-menu if the link has no destination
|
||||
if ( '#' === url || '' === url ) {
|
||||
e.preventDefault();
|
||||
var closestLi = this.closest( 'li' );
|
||||
closestLi.classList.toggle( 'sfHover' );
|
||||
var subMenu = closestLi.querySelector( '.sub-menu' );
|
||||
|
||||
if ( subMenu ) {
|
||||
subMenu.classList.toggle( 'toggled-on' );
|
||||
}
|
||||
}
|
||||
}
|
||||
}, false );
|
||||
}
|
||||
}
|
||||
|
||||
if ( body.classList.contains( 'dropdown-hover' ) ) {
|
||||
var menuBarItems = document.querySelectorAll( '.menu-bar-items .menu-bar-item > a' );
|
||||
|
||||
/**
|
||||
* Make menu items tab accessible when using the hover dropdown type
|
||||
*/
|
||||
var toggleFocus = function() {
|
||||
if ( this.closest( 'nav' ).classList.contains( 'toggled' ) || this.closest( 'nav' ).classList.contains( 'slideout-navigation' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
||||
while ( -1 === self.className.indexOf( 'main-nav' ) ) {
|
||||
if ( 'li' === self.tagName.toLowerCase() ) {
|
||||
self.classList.toggle( 'sfHover' );
|
||||
}
|
||||
|
||||
self = self.parentElement;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Make our menu bar items tab accessible.
|
||||
*/
|
||||
var toggleMenuBarItemFocus = function() {
|
||||
if ( this.closest( 'nav' ).classList.contains( 'toggled' ) || this.closest( 'nav' ).classList.contains( 'slideout-navigation' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
||||
while ( -1 === self.className.indexOf( 'menu-bar-items' ) ) {
|
||||
if ( self.classList.contains( 'menu-bar-item' ) ) {
|
||||
self.classList.toggle( 'sfHover' );
|
||||
}
|
||||
|
||||
self = self.parentElement;
|
||||
}
|
||||
};
|
||||
|
||||
for ( i = 0; i < navLinks.length; i++ ) {
|
||||
navLinks[ i ].addEventListener( 'focus', toggleFocus );
|
||||
navLinks[ i ].addEventListener( 'blur', toggleFocus );
|
||||
}
|
||||
|
||||
for ( i = 0; i < menuBarItems.length; i++ ) {
|
||||
menuBarItems[ i ].addEventListener( 'focus', toggleMenuBarItemFocus );
|
||||
menuBarItems[ i ].addEventListener( 'blur', toggleMenuBarItemFocus );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Make hover dropdown touch-friendly.
|
||||
*/
|
||||
if ( 'ontouchend' in document.documentElement && document.body.classList.contains( 'dropdown-hover' ) ) {
|
||||
var parentElements = document.querySelectorAll( '.sf-menu .menu-item-has-children' );
|
||||
|
||||
for ( i = 0; i < parentElements.length; i++ ) {
|
||||
parentElements[ i ].addEventListener( 'touchend', function( e ) {
|
||||
// Bail on mobile
|
||||
if ( this.closest( 'nav' ).classList.contains( 'toggled' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( e.touches.length === 1 || e.touches.length === 0 ) {
|
||||
// Prevent touch events within dropdown bubbling down to document
|
||||
e.stopPropagation();
|
||||
|
||||
// Toggle hover
|
||||
if ( ! this.classList.contains( 'sfHover' ) ) {
|
||||
// Prevent link on first touch
|
||||
if ( e.target === this || e.target.parentNode === this || e.target.parentNode.parentNode ) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
// Close other sub-menus.
|
||||
var closestLi = this.closest( 'li' ),
|
||||
siblings = getSiblings( closestLi );
|
||||
|
||||
for ( i = 0; i < siblings.length; i++ ) {
|
||||
if ( siblings[ i ].classList.contains( 'sfHover' ) ) {
|
||||
siblings[ i ].classList.remove( 'sfHover' );
|
||||
}
|
||||
}
|
||||
|
||||
this.classList.add( 'sfHover' );
|
||||
|
||||
// Hide dropdown on touch outside
|
||||
var closeDropdown,
|
||||
thisItem = this;
|
||||
|
||||
document.addEventListener( 'touchend', closeDropdown = function( event ) {
|
||||
event.stopPropagation();
|
||||
|
||||
thisItem.classList.remove( 'sfHover' );
|
||||
document.removeEventListener( 'touchend', closeDropdown );
|
||||
} );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
}
|
||||
}() );
|
@ -1,126 +0,0 @@
|
||||
( function() {
|
||||
'use strict';
|
||||
|
||||
if ( 'querySelector' in document && 'addEventListener' in window ) {
|
||||
/**
|
||||
* Navigation search.
|
||||
*
|
||||
* @param {Object} e The event.
|
||||
* @param {Object} item The clicked item.
|
||||
*/
|
||||
var toggleSearch = function( e, item ) {
|
||||
e.preventDefault();
|
||||
|
||||
if ( ! item ) {
|
||||
item = this;
|
||||
}
|
||||
|
||||
var forms = document.querySelectorAll( '.navigation-search' ),
|
||||
toggles = document.querySelectorAll( '.search-item' ),
|
||||
focusableEls = document.querySelectorAll( 'a[href], area[href], input:not([disabled]):not(.navigation-search), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]' ),
|
||||
nav = '';
|
||||
|
||||
if ( item.closest( '.mobile-menu-control-wrapper' ) ) {
|
||||
nav = document.getElementById( 'site-navigation' );
|
||||
}
|
||||
|
||||
for ( var i = 0; i < forms.length; i++ ) {
|
||||
if ( forms[ i ].classList.contains( 'nav-search-active' ) ) {
|
||||
if ( forms[ i ].closest( '#sticky-placeholder' ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
forms[ i ].classList.remove( 'nav-search-active' );
|
||||
|
||||
var activeSearch = document.querySelector( '.has-active-search' );
|
||||
|
||||
if ( activeSearch ) {
|
||||
activeSearch.classList.remove( 'has-active-search' );
|
||||
}
|
||||
|
||||
for ( var t = 0; t < toggles.length; t++ ) {
|
||||
toggles[ t ].classList.remove( 'close-search' );
|
||||
toggles[ t ].classList.remove( 'active' );
|
||||
toggles[ t ].querySelector( 'a' ).setAttribute( 'aria-label', generatepressNavSearch.open );
|
||||
|
||||
// Allow tabindex on items again.
|
||||
for ( var f = 0; f < focusableEls.length; f++ ) {
|
||||
if ( ! focusableEls[ f ].closest( '.navigation-search' ) && ! focusableEls[ f ].closest( '.search-item' ) ) {
|
||||
focusableEls[ f ].removeAttribute( 'tabindex' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
document.activeElement.blur();
|
||||
} else {
|
||||
if ( forms[ i ].closest( '#sticky-placeholder' ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var openedMobileMenu = forms[ i ].closest( '.toggled' );
|
||||
|
||||
if ( openedMobileMenu ) {
|
||||
// Close the mobile menu.
|
||||
openedMobileMenu.querySelector( 'button.menu-toggle' ).click();
|
||||
}
|
||||
|
||||
if ( nav ) {
|
||||
nav.classList.add( 'has-active-search' );
|
||||
}
|
||||
|
||||
forms[ i ].classList.add( 'nav-search-active' );
|
||||
|
||||
var container = this.closest( 'nav' );
|
||||
|
||||
if ( container ) {
|
||||
if ( container.classList.contains( 'mobile-menu-control-wrapper' ) ) {
|
||||
container = nav;
|
||||
}
|
||||
|
||||
var searchField = container.querySelector( '.search-field' );
|
||||
|
||||
if ( searchField ) {
|
||||
searchField.focus();
|
||||
}
|
||||
}
|
||||
|
||||
for ( t = 0; t < toggles.length; t++ ) {
|
||||
toggles[ t ].classList.add( 'active' );
|
||||
toggles[ t ].querySelector( 'a' ).setAttribute( 'aria-label', generatepressNavSearch.close );
|
||||
|
||||
// Trap tabindex within the search element
|
||||
for ( f = 0; f < focusableEls.length; f++ ) {
|
||||
if ( ! focusableEls[ f ].closest( '.navigation-search' ) && ! focusableEls[ f ].closest( '.search-item' ) ) {
|
||||
focusableEls[ f ].setAttribute( 'tabindex', '-1' );
|
||||
}
|
||||
}
|
||||
|
||||
toggles[ t ].classList.add( 'close-search' );
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if ( document.body.classList.contains( 'nav-search-enabled' ) ) {
|
||||
var searchItems = document.querySelectorAll( '.search-item' );
|
||||
|
||||
for ( var i = 0; i < searchItems.length; i++ ) {
|
||||
searchItems[ i ].addEventListener( 'click', toggleSearch, false );
|
||||
}
|
||||
|
||||
// Close navigation search on escape key
|
||||
document.addEventListener( 'keydown', function( e ) {
|
||||
if ( document.querySelector( '.navigation-search.nav-search-active' ) ) {
|
||||
if ( 'Escape' === e.key ) {
|
||||
var activeSearchItems = document.querySelectorAll( '.search-item.active' );
|
||||
|
||||
for ( var activeSearchItem = 0; activeSearchItem < activeSearchItems.length; activeSearchItem++ ) {
|
||||
toggleSearch( e, activeSearchItems[ activeSearchItem ] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}, false );
|
||||
}
|
||||
}
|
||||
}() );
|
@ -1 +0,0 @@
|
||||
!function(){"use strict";if("querySelector"in document&&"addEventListener"in window){var s=function(e,t){e.preventDefault(),t=t||this;var a=document.querySelectorAll(".navigation-search"),s=document.querySelectorAll(".search-item"),c=document.querySelectorAll('a[href], area[href], input:not([disabled]):not(.navigation-search), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),r="";t.closest(".mobile-menu-control-wrapper")&&(r=document.getElementById("site-navigation"));for(var i=0;i<a.length;i++)if(a[i].classList.contains("nav-search-active")){if(!a[i].closest("#sticky-placeholder")){a[i].classList.remove("nav-search-active");var n=document.querySelector(".has-active-search");n&&n.classList.remove("has-active-search");for(var o=0;o<s.length;o++){s[o].classList.remove("close-search"),s[o].classList.remove("active"),s[o].querySelector("a").setAttribute("aria-label",generatepressNavSearch.open);for(var l=0;l<c.length;l++)c[l].closest(".navigation-search")||c[l].closest(".search-item")||c[l].removeAttribute("tabindex")}document.activeElement.blur()}}else if(!a[i].closest("#sticky-placeholder")){var n=a[i].closest(".toggled"),d=(n&&n.querySelector("button.menu-toggle").click(),r&&r.classList.add("has-active-search"),a[i].classList.add("nav-search-active"),this.closest("nav"));for(d&&(d=(d=d.classList.contains("mobile-menu-control-wrapper")?r:d).querySelector(".search-field"))&&d.focus(),o=0;o<s.length;o++){for(s[o].classList.add("active"),s[o].querySelector("a").setAttribute("aria-label",generatepressNavSearch.close),l=0;l<c.length;l++)c[l].closest(".navigation-search")||c[l].closest(".search-item")||c[l].setAttribute("tabindex","-1");s[o].classList.add("close-search")}}};if(document.body.classList.contains("nav-search-enabled")){for(var e=document.querySelectorAll(".search-item"),t=0;t<e.length;t++)e[t].addEventListener("click",s,!1);document.addEventListener("keydown",function(e){if(document.querySelector(".navigation-search.nav-search-active")&&"Escape"===e.key)for(var t=document.querySelectorAll(".search-item.active"),a=0;a<t.length;a++){s(e,t[a]);break}},!1)}}}();
|
@ -1,130 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying Comments.
|
||||
*
|
||||
* The area of the page that contains both current comments
|
||||
* and the comment form. The actual display of comments is
|
||||
* handled by a callback to generate_comment() which is
|
||||
* located in the inc/template-tags.php file.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/*
|
||||
* If the current post is protected by a password and
|
||||
* the visitor has not yet entered the password we will
|
||||
* return early without loading the comments.
|
||||
*/
|
||||
if ( post_password_required() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* generate_before_comments hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
do_action( 'generate_before_comments' );
|
||||
?>
|
||||
<div id="comments">
|
||||
|
||||
<?php
|
||||
/**
|
||||
* generate_inside_comments hook.
|
||||
*
|
||||
* @since 1.3.47
|
||||
*/
|
||||
do_action( 'generate_inside_comments' );
|
||||
|
||||
if ( have_comments() ) :
|
||||
$comments_number = get_comments_number();
|
||||
$comments_title = apply_filters(
|
||||
'generate_comment_form_title',
|
||||
sprintf(
|
||||
esc_html(
|
||||
/* translators: 1: number of comments, 2: post title */
|
||||
_nx(
|
||||
'%1$s thought on “%2$s”',
|
||||
'%1$s thoughts on “%2$s”',
|
||||
$comments_number,
|
||||
'comments title',
|
||||
'generatepress'
|
||||
)
|
||||
),
|
||||
number_format_i18n( $comments_number ),
|
||||
get_the_title()
|
||||
)
|
||||
);
|
||||
|
||||
// phpcs:ignore -- Title escaped in output.
|
||||
echo apply_filters(
|
||||
'generate_comments_title_output',
|
||||
sprintf(
|
||||
'<h3 class="comments-title">%s</h3>',
|
||||
esc_html( $comments_title )
|
||||
),
|
||||
$comments_title,
|
||||
$comments_number
|
||||
);
|
||||
|
||||
/**
|
||||
* generate_below_comments_title hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
do_action( 'generate_below_comments_title' );
|
||||
|
||||
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
|
||||
?>
|
||||
<nav id="comment-nav-above" class="comment-navigation" role="navigation">
|
||||
<h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'generatepress' ); ?></h2>
|
||||
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'generatepress' ) ); ?></div>
|
||||
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'generatepress' ) ); ?></div>
|
||||
</nav><!-- #comment-nav-above -->
|
||||
<?php endif; ?>
|
||||
|
||||
<ol class="comment-list">
|
||||
<?php
|
||||
/*
|
||||
* Loop through and list the comments. Tell wp_list_comments()
|
||||
* to use generate_comment() to format the comments.
|
||||
* If you want to override this in a child theme, then you can
|
||||
* define generate_comment() and that will be used instead.
|
||||
* See generate_comment() in inc/template-tags.php for more.
|
||||
*/
|
||||
wp_list_comments(
|
||||
array(
|
||||
'callback' => 'generate_comment',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</ol><!-- .comment-list -->
|
||||
|
||||
<?php
|
||||
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
|
||||
?>
|
||||
<nav id="comment-nav-below" class="comment-navigation" role="navigation">
|
||||
<h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'generatepress' ); ?></h2>
|
||||
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'generatepress' ) ); ?></div>
|
||||
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'generatepress' ) ); ?></div>
|
||||
</nav><!-- #comment-nav-below -->
|
||||
<?php
|
||||
endif;
|
||||
|
||||
endif;
|
||||
|
||||
// phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
|
||||
if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
|
||||
?>
|
||||
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'generatepress' ); ?></p>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
comment_form();
|
||||
?>
|
||||
|
||||
</div><!-- #comments -->
|
@ -1,67 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying 404 pages.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
?>
|
||||
<div class="inside-article">
|
||||
|
||||
<?php
|
||||
/**
|
||||
* generate_before_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_featured_page_header_inside_single - 10
|
||||
*/
|
||||
do_action( 'generate_before_content' );
|
||||
?>
|
||||
|
||||
<header <?php generate_do_attr( 'entry-header' ); ?>>
|
||||
<?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML is allowed in filter here. ?>
|
||||
<h1 class="entry-title" itemprop="headline"><?php echo apply_filters( 'generate_404_title', __( 'Oops! That page can’t be found.', 'generatepress' ) ); ?></h1>
|
||||
</header>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* generate_after_entry_header hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_post_image - 10
|
||||
*/
|
||||
do_action( 'generate_after_entry_header' );
|
||||
|
||||
$itemprop = '';
|
||||
|
||||
if ( 'microdata' === generate_get_schema_type() ) {
|
||||
$itemprop = ' itemprop="text"';
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="entry-content"<?php echo $itemprop; // phpcs:ignore -- No escaping needed. ?>>
|
||||
<?php
|
||||
printf(
|
||||
'<p>%s</p>',
|
||||
apply_filters( 'generate_404_text', __( 'It looks like nothing was found at this location. Maybe try searching?', 'generatepress' ) ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- HTML is allowed in filter here.
|
||||
);
|
||||
|
||||
get_search_form();
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* generate_after_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
do_action( 'generate_after_content' );
|
||||
?>
|
||||
|
||||
</div>
|
@ -1,111 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying Link post formats.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
?>
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_do_microdata( 'article' ); ?>>
|
||||
<div class="inside-article">
|
||||
<?php
|
||||
/**
|
||||
* generate_before_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_featured_page_header_inside_single - 10
|
||||
*/
|
||||
do_action( 'generate_before_content' );
|
||||
|
||||
if ( generate_show_entry_header() ) :
|
||||
?>
|
||||
<header <?php generate_do_attr( 'entry-header' ); ?>>
|
||||
<?php
|
||||
/**
|
||||
* generate_before_entry_title hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
do_action( 'generate_before_entry_title' );
|
||||
|
||||
if ( generate_show_title() ) {
|
||||
$params = generate_get_the_title_parameters();
|
||||
|
||||
the_title( $params['before'], $params['after'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* generate_after_entry_title hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_post_meta - 10
|
||||
*/
|
||||
do_action( 'generate_after_entry_title' );
|
||||
?>
|
||||
</header>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
/**
|
||||
* generate_after_entry_header hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_post_image - 10
|
||||
*/
|
||||
do_action( 'generate_after_entry_header' );
|
||||
|
||||
$itemprop = '';
|
||||
|
||||
if ( 'microdata' === generate_get_schema_type() ) {
|
||||
$itemprop = ' itemprop="text"';
|
||||
}
|
||||
|
||||
if ( generate_show_excerpt() ) :
|
||||
?>
|
||||
|
||||
<div class="entry-summary"<?php echo $itemprop; // phpcs:ignore -- No escaping needed. ?>>
|
||||
<?php the_excerpt(); ?>
|
||||
</div>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div class="entry-content"<?php echo $itemprop; // phpcs:ignore -- No escaping needed. ?>>
|
||||
<?php
|
||||
the_content();
|
||||
|
||||
wp_link_pages(
|
||||
array(
|
||||
'before' => '<div class="page-links">' . __( 'Pages:', 'generatepress' ),
|
||||
'after' => '</div>',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
|
||||
/**
|
||||
* generate_after_entry_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_footer_meta - 10
|
||||
*/
|
||||
do_action( 'generate_after_entry_content' );
|
||||
|
||||
/**
|
||||
* generate_after_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
do_action( 'generate_after_content' );
|
||||
?>
|
||||
</div>
|
||||
</article>
|
@ -1,93 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The template used for displaying page content in page.php
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_do_microdata( 'article' ); ?>>
|
||||
<div class="inside-article">
|
||||
<?php
|
||||
/**
|
||||
* generate_before_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_featured_page_header_inside_single - 10
|
||||
*/
|
||||
do_action( 'generate_before_content' );
|
||||
|
||||
if ( generate_show_entry_header() ) :
|
||||
?>
|
||||
|
||||
<header <?php generate_do_attr( 'entry-header' ); ?>>
|
||||
<?php
|
||||
/**
|
||||
* generate_before_page_title hook.
|
||||
*
|
||||
* @since 2.4
|
||||
*/
|
||||
do_action( 'generate_before_page_title' );
|
||||
|
||||
if ( generate_show_title() ) {
|
||||
$params = generate_get_the_title_parameters();
|
||||
|
||||
the_title( $params['before'], $params['after'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* generate_after_page_title hook.
|
||||
*
|
||||
* @since 2.4
|
||||
*/
|
||||
do_action( 'generate_after_page_title' );
|
||||
?>
|
||||
</header>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
|
||||
/**
|
||||
* generate_after_entry_header hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_post_image - 10
|
||||
*/
|
||||
do_action( 'generate_after_entry_header' );
|
||||
|
||||
$itemprop = '';
|
||||
|
||||
if ( 'microdata' === generate_get_schema_type() ) {
|
||||
$itemprop = ' itemprop="text"';
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="entry-content"<?php echo $itemprop; // phpcs:ignore -- No escaping needed. ?>>
|
||||
<?php
|
||||
the_content();
|
||||
|
||||
wp_link_pages(
|
||||
array(
|
||||
'before' => '<div class="page-links">' . __( 'Pages:', 'generatepress' ),
|
||||
'after' => '</div>',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* generate_after_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
do_action( 'generate_after_content' );
|
||||
?>
|
||||
</div>
|
||||
</article>
|
@ -1,102 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying single posts.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_do_microdata( 'article' ); ?>>
|
||||
<div class="inside-article">
|
||||
<?php
|
||||
/**
|
||||
* generate_before_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_featured_page_header_inside_single - 10
|
||||
*/
|
||||
do_action( 'generate_before_content' );
|
||||
|
||||
if ( generate_show_entry_header() ) :
|
||||
?>
|
||||
<header <?php generate_do_attr( 'entry-header' ); ?>>
|
||||
<?php
|
||||
/**
|
||||
* generate_before_entry_title hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
do_action( 'generate_before_entry_title' );
|
||||
|
||||
if ( generate_show_title() ) {
|
||||
$params = generate_get_the_title_parameters();
|
||||
|
||||
the_title( $params['before'], $params['after'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* generate_after_entry_title hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_post_meta - 10
|
||||
*/
|
||||
do_action( 'generate_after_entry_title' );
|
||||
?>
|
||||
</header>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
/**
|
||||
* generate_after_entry_header hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_post_image - 10
|
||||
*/
|
||||
do_action( 'generate_after_entry_header' );
|
||||
|
||||
$itemprop = '';
|
||||
|
||||
if ( 'microdata' === generate_get_schema_type() ) {
|
||||
$itemprop = ' itemprop="text"';
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="entry-content"<?php echo $itemprop; // phpcs:ignore -- No escaping needed. ?>>
|
||||
<?php
|
||||
the_content();
|
||||
|
||||
wp_link_pages(
|
||||
array(
|
||||
'before' => '<div class="page-links">' . __( 'Pages:', 'generatepress' ),
|
||||
'after' => '</div>',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* generate_after_entry_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_footer_meta - 10
|
||||
*/
|
||||
do_action( 'generate_after_entry_content' );
|
||||
|
||||
/**
|
||||
* generate_after_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
do_action( 'generate_after_content' );
|
||||
?>
|
||||
</div>
|
||||
</article>
|
@ -1,111 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying posts within the loop.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
?>
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_do_microdata( 'article' ); ?>>
|
||||
<div class="inside-article">
|
||||
<?php
|
||||
/**
|
||||
* generate_before_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_featured_page_header_inside_single - 10
|
||||
*/
|
||||
do_action( 'generate_before_content' );
|
||||
|
||||
if ( generate_show_entry_header() ) :
|
||||
?>
|
||||
<header <?php generate_do_attr( 'entry-header' ); ?>>
|
||||
<?php
|
||||
/**
|
||||
* generate_before_entry_title hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
do_action( 'generate_before_entry_title' );
|
||||
|
||||
if ( generate_show_title() ) {
|
||||
$params = generate_get_the_title_parameters();
|
||||
|
||||
the_title( $params['before'], $params['after'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* generate_after_entry_title hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_post_meta - 10
|
||||
*/
|
||||
do_action( 'generate_after_entry_title' );
|
||||
?>
|
||||
</header>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
/**
|
||||
* generate_after_entry_header hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_post_image - 10
|
||||
*/
|
||||
do_action( 'generate_after_entry_header' );
|
||||
|
||||
$itemprop = '';
|
||||
|
||||
if ( 'microdata' === generate_get_schema_type() ) {
|
||||
$itemprop = ' itemprop="text"';
|
||||
}
|
||||
|
||||
if ( generate_show_excerpt() ) :
|
||||
?>
|
||||
|
||||
<div class="entry-summary"<?php echo $itemprop; // phpcs:ignore -- No escaping needed. ?>>
|
||||
<?php the_excerpt(); ?>
|
||||
</div>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div class="entry-content"<?php echo $itemprop; // phpcs:ignore -- No escaping needed. ?>>
|
||||
<?php
|
||||
the_content();
|
||||
|
||||
wp_link_pages(
|
||||
array(
|
||||
'before' => '<div class="page-links">' . __( 'Pages:', 'generatepress' ),
|
||||
'after' => '</div>',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
|
||||
/**
|
||||
* generate_after_entry_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_footer_meta - 10
|
||||
*/
|
||||
do_action( 'generate_after_entry_content' );
|
||||
|
||||
/**
|
||||
* generate_after_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
do_action( 'generate_after_content' );
|
||||
?>
|
||||
</div>
|
||||
</article>
|
@ -1,65 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying the footer.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* generate_before_footer hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
do_action( 'generate_before_footer' );
|
||||
?>
|
||||
|
||||
<div <?php generate_do_attr( 'footer' ); ?>>
|
||||
<?php
|
||||
/**
|
||||
* generate_before_footer_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
do_action( 'generate_before_footer_content' );
|
||||
|
||||
/**
|
||||
* generate_footer hook.
|
||||
*
|
||||
* @since 1.3.42
|
||||
*
|
||||
* @hooked generate_construct_footer_widgets - 5
|
||||
* @hooked generate_construct_footer - 10
|
||||
*/
|
||||
do_action( 'generate_footer' );
|
||||
|
||||
/**
|
||||
* generate_after_footer_content hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
do_action( 'generate_after_footer_content' );
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* generate_after_footer hook.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
do_action( 'generate_after_footer' );
|
||||
|
||||
wp_footer();
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,123 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* GeneratePress.
|
||||
*
|
||||
* Please do not make any edits to this file. All edits should be done in a child theme.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
// Set our theme version.
|
||||
define( 'GENERATE_VERSION', '3.4.0' );
|
||||
|
||||
if ( ! function_exists( 'generate_setup' ) ) {
|
||||
add_action( 'after_setup_theme', 'generate_setup' );
|
||||
/**
|
||||
* Sets up theme defaults and registers support for various WordPress features.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
function generate_setup() {
|
||||
// Make theme available for translation.
|
||||
load_theme_textdomain( 'generatepress' );
|
||||
|
||||
// Add theme support for various features.
|
||||
add_theme_support( 'automatic-feed-links' );
|
||||
add_theme_support( 'post-thumbnails' );
|
||||
add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'status' ) );
|
||||
add_theme_support( 'woocommerce' );
|
||||
add_theme_support( 'title-tag' );
|
||||
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'script', 'style' ) );
|
||||
add_theme_support( 'customize-selective-refresh-widgets' );
|
||||
add_theme_support( 'align-wide' );
|
||||
add_theme_support( 'responsive-embeds' );
|
||||
|
||||
$color_palette = generate_get_editor_color_palette();
|
||||
|
||||
if ( ! empty( $color_palette ) ) {
|
||||
add_theme_support( 'editor-color-palette', $color_palette );
|
||||
}
|
||||
|
||||
add_theme_support(
|
||||
'custom-logo',
|
||||
array(
|
||||
'height' => 70,
|
||||
'width' => 350,
|
||||
'flex-height' => true,
|
||||
'flex-width' => true,
|
||||
)
|
||||
);
|
||||
|
||||
// Register primary menu.
|
||||
register_nav_menus(
|
||||
array(
|
||||
'primary' => __( 'Primary Menu', 'generatepress' ),
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Set the content width to something large
|
||||
* We set a more accurate width in generate_smart_content_width()
|
||||
*/
|
||||
global $content_width;
|
||||
if ( ! isset( $content_width ) ) {
|
||||
$content_width = 1200; /* pixels */
|
||||
}
|
||||
|
||||
// Add editor styles to the block editor.
|
||||
add_theme_support( 'editor-styles' );
|
||||
|
||||
$editor_styles = apply_filters(
|
||||
'generate_editor_styles',
|
||||
array(
|
||||
'assets/css/admin/block-editor.css',
|
||||
)
|
||||
);
|
||||
|
||||
add_editor_style( $editor_styles );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all necessary theme files
|
||||
*/
|
||||
$theme_dir = get_template_directory();
|
||||
|
||||
require $theme_dir . '/inc/theme-functions.php';
|
||||
require $theme_dir . '/inc/defaults.php';
|
||||
require $theme_dir . '/inc/class-css.php';
|
||||
require $theme_dir . '/inc/css-output.php';
|
||||
require $theme_dir . '/inc/general.php';
|
||||
require $theme_dir . '/inc/customizer.php';
|
||||
require $theme_dir . '/inc/markup.php';
|
||||
require $theme_dir . '/inc/typography.php';
|
||||
require $theme_dir . '/inc/plugin-compat.php';
|
||||
require $theme_dir . '/inc/block-editor.php';
|
||||
require $theme_dir . '/inc/class-typography.php';
|
||||
require $theme_dir . '/inc/class-typography-migration.php';
|
||||
require $theme_dir . '/inc/class-html-attributes.php';
|
||||
require $theme_dir . '/inc/class-theme-update.php';
|
||||
require $theme_dir . '/inc/class-rest.php';
|
||||
require $theme_dir . '/inc/deprecated.php';
|
||||
|
||||
if ( is_admin() ) {
|
||||
require $theme_dir . '/inc/meta-box.php';
|
||||
require $theme_dir . '/inc/class-dashboard.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Load our theme structure
|
||||
*/
|
||||
require $theme_dir . '/inc/structure/archives.php';
|
||||
require $theme_dir . '/inc/structure/comments.php';
|
||||
require $theme_dir . '/inc/structure/featured-images.php';
|
||||
require $theme_dir . '/inc/structure/footer.php';
|
||||
require $theme_dir . '/inc/structure/header.php';
|
||||
require $theme_dir . '/inc/structure/navigation.php';
|
||||
require $theme_dir . '/inc/structure/post-meta.php';
|
||||
require $theme_dir . '/inc/structure/sidebars.php';
|
||||
require $theme_dir . '/inc/structure/search-modal.php';
|
@ -1,74 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying the header.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
?><!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?>>
|
||||
<head>
|
||||
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
||||
<?php wp_head(); ?>
|
||||
</head>
|
||||
|
||||
<body <?php body_class(); ?> <?php generate_do_microdata( 'body' ); ?>>
|
||||
<?php
|
||||
/**
|
||||
* wp_body_open hook.
|
||||
*
|
||||
* @since 2.3
|
||||
*/
|
||||
do_action( 'wp_body_open' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- core WP hook.
|
||||
|
||||
/**
|
||||
* generate_before_header hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_do_skip_to_content_link - 2
|
||||
* @hooked generate_top_bar - 5
|
||||
* @hooked generate_add_navigation_before_header - 5
|
||||
*/
|
||||
do_action( 'generate_before_header' );
|
||||
|
||||
/**
|
||||
* generate_header hook.
|
||||
*
|
||||
* @since 1.3.42
|
||||
*
|
||||
* @hooked generate_construct_header - 10
|
||||
*/
|
||||
do_action( 'generate_header' );
|
||||
|
||||
/**
|
||||
* generate_after_header hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*
|
||||
* @hooked generate_featured_page_header - 10
|
||||
*/
|
||||
do_action( 'generate_after_header' );
|
||||
?>
|
||||
|
||||
<div <?php generate_do_attr( 'page' ); ?>>
|
||||
<?php
|
||||
/**
|
||||
* generate_inside_site_container hook.
|
||||
*
|
||||
* @since 2.4
|
||||
*/
|
||||
do_action( 'generate_inside_site_container' );
|
||||
?>
|
||||
<div <?php generate_do_attr( 'site-content' ); ?>>
|
||||
<?php
|
||||
/**
|
||||
* generate_inside_container hook.
|
||||
*
|
||||
* @since 0.1
|
||||
*/
|
||||
do_action( 'generate_inside_container' );
|
@ -1,521 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Integrate GeneratePress with the WordPress block editor.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* Check what sidebar layout we're using.
|
||||
* We need this function as the post meta in generate_get_layout() only runs
|
||||
* on is_singular()
|
||||
*
|
||||
* @since 2.2
|
||||
*
|
||||
* @param bool $meta Check for post meta.
|
||||
* @return string The saved sidebar layout.
|
||||
*/
|
||||
function generate_get_block_editor_sidebar_layout( $meta = true ) {
|
||||
$layout = generate_get_option( 'layout_setting' );
|
||||
|
||||
if ( function_exists( 'get_current_screen' ) ) {
|
||||
$screen = get_current_screen();
|
||||
|
||||
if ( is_object( $screen ) && 'post' === $screen->post_type ) {
|
||||
$layout = generate_get_option( 'single_layout_setting' );
|
||||
}
|
||||
}
|
||||
|
||||
// Add in our default filter in case people have adjusted it.
|
||||
$layout = apply_filters( 'generate_sidebar_layout', $layout );
|
||||
|
||||
if ( $meta ) {
|
||||
$layout_meta = get_post_meta( get_the_ID(), '_generate-sidebar-layout-meta', true );
|
||||
|
||||
if ( $layout_meta ) {
|
||||
$layout = $layout_meta;
|
||||
}
|
||||
}
|
||||
|
||||
return apply_filters( 'generate_block_editor_sidebar_layout', $layout );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether we're disabling the content title or not.
|
||||
* We need this function as the post meta in generate_show_title() only runs
|
||||
* on is_singular()
|
||||
*
|
||||
* @since 2.2
|
||||
*/
|
||||
function generate_get_block_editor_show_content_title() {
|
||||
$title = generate_show_title();
|
||||
|
||||
$disable_title = get_post_meta( get_the_ID(), '_generate-disable-headline', true );
|
||||
|
||||
if ( $disable_title ) {
|
||||
$title = false;
|
||||
}
|
||||
|
||||
return apply_filters( 'generate_block_editor_show_content_title', $title );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the content width for this post.
|
||||
*
|
||||
* @since 2.2
|
||||
*/
|
||||
function generate_get_block_editor_content_width() {
|
||||
$container_width = generate_get_option( 'container_width' );
|
||||
|
||||
$content_width = $container_width;
|
||||
|
||||
$right_sidebar_width = apply_filters( 'generate_right_sidebar_width', '25' );
|
||||
|
||||
$left_sidebar_width = apply_filters( 'generate_left_sidebar_width', '25' );
|
||||
|
||||
$layout = generate_get_block_editor_sidebar_layout();
|
||||
|
||||
if ( 'left-sidebar' === $layout ) {
|
||||
$content_width = $container_width * ( ( 100 - $left_sidebar_width ) / 100 );
|
||||
} elseif ( 'right-sidebar' === $layout ) {
|
||||
$content_width = $container_width * ( ( 100 - $right_sidebar_width ) / 100 );
|
||||
} elseif ( 'no-sidebar' === $layout ) {
|
||||
$content_width = $container_width;
|
||||
} else {
|
||||
$content_width = $container_width * ( ( 100 - ( $left_sidebar_width + $right_sidebar_width ) ) / 100 );
|
||||
}
|
||||
|
||||
return apply_filters( 'generate_block_editor_content_width', $content_width );
|
||||
}
|
||||
|
||||
add_filter( 'block_editor_settings_all', 'generate_add_inline_block_editor_styles' );
|
||||
/**
|
||||
* Add dynamic inline styles to the block editor content.
|
||||
*
|
||||
* @param array $editor_settings The existing editor settings.
|
||||
*/
|
||||
function generate_add_inline_block_editor_styles( $editor_settings ) {
|
||||
$show_editor_styles = apply_filters( 'generate_show_block_editor_styles', true );
|
||||
|
||||
if ( $show_editor_styles ) {
|
||||
if ( generate_is_using_dynamic_typography() ) {
|
||||
$google_fonts_uri = GeneratePress_Typography::get_google_fonts_uri();
|
||||
|
||||
if ( $google_fonts_uri ) {
|
||||
// Need to use @import for now until this is ready: https://github.com/WordPress/gutenberg/pull/35950.
|
||||
$google_fonts_import = sprintf(
|
||||
'@import "%s";',
|
||||
$google_fonts_uri
|
||||
);
|
||||
|
||||
$editor_settings['styles'][] = array( 'css' => $google_fonts_import );
|
||||
}
|
||||
}
|
||||
|
||||
$editor_settings['styles'][] = array( 'css' => wp_strip_all_tags( generate_do_inline_block_editor_css() ) );
|
||||
|
||||
if ( generate_is_using_dynamic_typography() ) {
|
||||
$editor_settings['styles'][] = array( 'css' => wp_strip_all_tags( GeneratePress_Typography::get_css( 'core' ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
return $editor_settings;
|
||||
}
|
||||
|
||||
add_action( 'enqueue_block_editor_assets', 'generate_enqueue_google_fonts' );
|
||||
add_action( 'enqueue_block_editor_assets', 'generate_enqueue_backend_block_editor_assets' );
|
||||
/**
|
||||
* Add CSS to the admin side of the block editor.
|
||||
*
|
||||
* @since 2.2
|
||||
*/
|
||||
function generate_enqueue_backend_block_editor_assets() {
|
||||
wp_enqueue_script(
|
||||
'generate-block-editor',
|
||||
trailingslashit( get_template_directory_uri() ) . 'assets/dist/block-editor.js',
|
||||
array( 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-plugins', 'wp-polyfill' ),
|
||||
GENERATE_VERSION,
|
||||
true
|
||||
);
|
||||
|
||||
$color_settings = wp_parse_args(
|
||||
get_option( 'generate_settings', array() ),
|
||||
generate_get_color_defaults()
|
||||
);
|
||||
|
||||
$spacing_settings = wp_parse_args(
|
||||
get_option( 'generate_spacing_settings', array() ),
|
||||
generate_spacing_get_defaults()
|
||||
);
|
||||
|
||||
$text_color = generate_get_option( 'text_color' );
|
||||
|
||||
if ( $color_settings['content_text_color'] ) {
|
||||
$text_color = $color_settings['content_text_color'];
|
||||
}
|
||||
|
||||
$sidebar_layout = get_post_meta( get_the_ID(), '_generate_sidebar_layout', true );
|
||||
$content_area_type = get_post_meta( get_the_ID(), '_generate-full-width-content', true );
|
||||
|
||||
wp_localize_script(
|
||||
'generate-block-editor',
|
||||
'generatepressBlockEditor',
|
||||
array(
|
||||
'sidebarLayout' => $sidebar_layout ? $sidebar_layout : generate_get_block_editor_sidebar_layout( false ),
|
||||
'containerWidth' => generate_get_option( 'container_width' ),
|
||||
'contentPaddingRight' => absint( $spacing_settings['content_right'] ) . 'px',
|
||||
'contentPaddingLeft' => absint( $spacing_settings['content_left'] ) . 'px',
|
||||
'rightSidebarWidth' => apply_filters( 'generate_right_sidebar_width', '25' ),
|
||||
'leftSidebarWidth' => apply_filters( 'generate_left_sidebar_width', '25' ),
|
||||
'text_color' => $text_color,
|
||||
'show_editor_styles' => apply_filters( 'generate_show_block_editor_styles', true ),
|
||||
'contentAreaType' => $content_area_type ? $content_area_type : apply_filters( 'generate_block_editor_content_area_type', '' ),
|
||||
'customContentWidth' => apply_filters( 'generate_block_editor_container_width', '' ),
|
||||
)
|
||||
);
|
||||
|
||||
wp_register_style( 'generate-block-editor', false, array(), true, true );
|
||||
wp_add_inline_style( 'generate-block-editor', generate_do_inline_block_editor_css( 'block-editor' ) );
|
||||
wp_enqueue_style( 'generate-block-editor' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Write our CSS for the block editor.
|
||||
*
|
||||
* @since 2.2
|
||||
* @param string $for Define whether this CSS for the block content or the block editor.
|
||||
*/
|
||||
function generate_do_inline_block_editor_css( $for = 'block-content' ) {
|
||||
$css = new GeneratePress_CSS();
|
||||
|
||||
$css->set_selector( ':root' );
|
||||
|
||||
$global_colors = generate_get_global_colors();
|
||||
|
||||
if ( ! empty( $global_colors ) ) {
|
||||
foreach ( (array) $global_colors as $key => $data ) {
|
||||
if ( ! empty( $data['slug'] ) && ! empty( $data['color'] ) ) {
|
||||
$css->add_property( '--' . $data['slug'], $data['color'] );
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( (array) $global_colors as $key => $data ) {
|
||||
if ( ! empty( $data['slug'] ) && ! empty( $data['color'] ) ) {
|
||||
$css->set_selector( '.has-' . $data['slug'] . '-color' );
|
||||
$css->add_property( 'color', 'var(--' . $data['slug'] . ')' );
|
||||
|
||||
$css->set_selector( '.has-' . $data['slug'] . '-background-color' );
|
||||
$css->add_property( 'background-color', 'var(--' . $data['slug'] . ')' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If this CSS is for the editor only (not the block content), we can return here.
|
||||
if ( 'block-editor' === $for ) {
|
||||
return $css->css_output();
|
||||
}
|
||||
|
||||
$color_settings = wp_parse_args(
|
||||
get_option( 'generate_settings', array() ),
|
||||
generate_get_color_defaults()
|
||||
);
|
||||
|
||||
$font_settings = wp_parse_args(
|
||||
get_option( 'generate_settings', array() ),
|
||||
generate_get_default_fonts()
|
||||
);
|
||||
|
||||
$content_width = generate_get_block_editor_content_width();
|
||||
|
||||
$spacing_settings = wp_parse_args(
|
||||
get_option( 'generate_spacing_settings', array() ),
|
||||
generate_spacing_get_defaults()
|
||||
);
|
||||
|
||||
$content_width_calc = sprintf(
|
||||
'calc(%1$s - %2$s - %3$s)',
|
||||
absint( $content_width ) . 'px',
|
||||
absint( $spacing_settings['content_left'] ) . 'px',
|
||||
absint( $spacing_settings['content_right'] ) . 'px'
|
||||
);
|
||||
|
||||
$css->set_selector( 'body' );
|
||||
$css->add_property(
|
||||
'--content-width',
|
||||
'true' === get_post_meta( get_the_ID(), '_generate-full-width-content', true )
|
||||
? '100%'
|
||||
: $content_width_calc
|
||||
);
|
||||
|
||||
$css->set_selector( 'body .wp-block' );
|
||||
$css->add_property( 'max-width', 'var(--content-width)' );
|
||||
|
||||
$css->set_selector( '.wp-block[data-align="full"]' );
|
||||
$css->add_property( 'max-width', 'none' );
|
||||
|
||||
$css->set_selector( '.wp-block[data-align="wide"]' );
|
||||
$css->add_property( 'max-width', absint( $content_width ), false, 'px' );
|
||||
|
||||
$underline_links = generate_get_option( 'underline_links' );
|
||||
|
||||
if ( 'never' !== $underline_links ) {
|
||||
if ( 'always' === $underline_links ) {
|
||||
$css->set_selector( '.wp-block a' );
|
||||
$css->add_property( 'text-decoration', 'underline' );
|
||||
}
|
||||
|
||||
if ( 'hover' === $underline_links ) {
|
||||
$css->set_selector( '.wp-block a' );
|
||||
$css->add_property( 'text-decoration', 'none' );
|
||||
|
||||
$css->set_selector( '.wp-block a:hover, .wp-block a:focus' );
|
||||
$css->add_property( 'text-decoration', 'underline' );
|
||||
}
|
||||
|
||||
if ( 'not-hover' === $underline_links ) {
|
||||
$css->set_selector( '.wp-block a' );
|
||||
$css->add_property( 'text-decoration', 'underline' );
|
||||
|
||||
$css->set_selector( '.wp-block a:hover, .wp-block a:focus' );
|
||||
$css->add_property( 'text-decoration', 'none' );
|
||||
}
|
||||
|
||||
$css->set_selector( 'a.button, .wp-block-button__link' );
|
||||
$css->add_property( 'text-decoration', 'none' );
|
||||
} else {
|
||||
$css->set_selector( '.wp-block a' );
|
||||
$css->add_property( 'text-decoration', 'none' );
|
||||
}
|
||||
|
||||
if ( apply_filters( 'generate_do_group_inner_container_style', true ) ) {
|
||||
$css->set_selector( '.wp-block-group__inner-container' );
|
||||
$css->add_property( 'max-width', absint( $content_width ), false, 'px' );
|
||||
$css->add_property( 'margin-left', 'auto' );
|
||||
$css->add_property( 'margin-right', 'auto' );
|
||||
$css->add_property( 'padding', generate_padding_css( $spacing_settings['content_top'], $spacing_settings['content_right'], $spacing_settings['content_bottom'], $spacing_settings['content_left'] ) );
|
||||
}
|
||||
|
||||
$css->set_selector( 'a.button, a.button:visited, .wp-block-button__link:not(.has-background)' );
|
||||
$css->add_property( 'color', $color_settings['form_button_text_color'] );
|
||||
$css->add_property( 'background-color', $color_settings['form_button_background_color'] );
|
||||
$css->add_property( 'padding', '10px 20px' );
|
||||
$css->add_property( 'border', '0' );
|
||||
$css->add_property( 'border-radius', '0' );
|
||||
|
||||
$css->set_selector( 'a.button:hover, a.button:active, a.button:focus, .wp-block-button__link:not(.has-background):active, .wp-block-button__link:not(.has-background):focus, .wp-block-button__link:not(.has-background):hover' );
|
||||
$css->add_property( 'color', $color_settings['form_button_text_color_hover'] );
|
||||
$css->add_property( 'background-color', $color_settings['form_button_background_color_hover'] );
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$body_family = generate_get_font_family_css( 'font_body', 'generate_settings', generate_get_default_fonts() );
|
||||
$h1_family = generate_get_font_family_css( 'font_heading_1', 'generate_settings', generate_get_default_fonts() );
|
||||
$h2_family = generate_get_font_family_css( 'font_heading_2', 'generate_settings', generate_get_default_fonts() );
|
||||
$h3_family = generate_get_font_family_css( 'font_heading_3', 'generate_settings', generate_get_default_fonts() );
|
||||
$h4_family = generate_get_font_family_css( 'font_heading_4', 'generate_settings', generate_get_default_fonts() );
|
||||
$h5_family = generate_get_font_family_css( 'font_heading_5', 'generate_settings', generate_get_default_fonts() );
|
||||
$h6_family = generate_get_font_family_css( 'font_heading_6', 'generate_settings', generate_get_default_fonts() );
|
||||
$buttons_family = generate_get_font_family_css( 'font_buttons', 'generate_settings', generate_get_default_fonts() );
|
||||
}
|
||||
|
||||
$css->set_selector( 'body' );
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$css->add_property( 'font-family', $body_family );
|
||||
$css->add_property( 'font-size', absint( $font_settings['body_font_size'] ), false, 'px' );
|
||||
}
|
||||
|
||||
if ( $color_settings['content_text_color'] ) {
|
||||
$css->add_property( 'color', $color_settings['content_text_color'] );
|
||||
} else {
|
||||
$css->add_property( 'color', generate_get_option( 'text_color' ) );
|
||||
}
|
||||
|
||||
$css->set_selector( '.content-title-visibility' );
|
||||
|
||||
if ( $color_settings['content_text_color'] ) {
|
||||
$css->add_property( 'color', $color_settings['content_text_color'] );
|
||||
} else {
|
||||
$css->add_property( 'color', generate_get_option( 'text_color' ) );
|
||||
}
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$css->set_selector( 'body, p' );
|
||||
$css->add_property( 'line-height', floatval( $font_settings['body_line_height'] ) );
|
||||
|
||||
$css->set_selector( 'p' );
|
||||
$css->add_property( 'margin-top', '0px' );
|
||||
$css->add_property( 'margin-bottom', $font_settings['paragraph_margin'], false, 'em' );
|
||||
}
|
||||
|
||||
$css->set_selector( 'h1' );
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$css->add_property( 'font-family', 'inherit' === $h1_family || '' === $h1_family ? $body_family : $h1_family );
|
||||
$css->add_property( 'font-weight', $font_settings['heading_1_weight'] );
|
||||
$css->add_property( 'text-transform', $font_settings['heading_1_transform'] );
|
||||
$css->add_property( 'font-size', absint( $font_settings['heading_1_font_size'] ), false, 'px' );
|
||||
$css->add_property( 'line-height', floatval( $font_settings['heading_1_line_height'] ), false, 'em' );
|
||||
$css->add_property( 'margin-bottom', floatval( $font_settings['heading_1_margin_bottom'] ), false, 'px' );
|
||||
$css->add_property( 'margin-top', '0' );
|
||||
}
|
||||
|
||||
$css->add_property( 'color', $color_settings['h1_color'] );
|
||||
|
||||
if ( $color_settings['content_title_color'] ) {
|
||||
$css->set_selector( '.edit-post-visual-editor__post-title-wrapper h1' );
|
||||
$css->add_property( 'color', $color_settings['content_title_color'] );
|
||||
}
|
||||
|
||||
$css->set_selector( 'h2' );
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$css->add_property( 'font-family', $h2_family );
|
||||
$css->add_property( 'font-weight', $font_settings['heading_2_weight'] );
|
||||
$css->add_property( 'text-transform', $font_settings['heading_2_transform'] );
|
||||
$css->add_property( 'font-size', absint( $font_settings['heading_2_font_size'] ), false, 'px' );
|
||||
$css->add_property( 'line-height', floatval( $font_settings['heading_2_line_height'] ), false, 'em' );
|
||||
$css->add_property( 'margin-bottom', floatval( $font_settings['heading_2_margin_bottom'] ), false, 'px' );
|
||||
$css->add_property( 'margin-top', '0' );
|
||||
}
|
||||
|
||||
$css->add_property( 'color', $color_settings['h2_color'] );
|
||||
|
||||
$css->set_selector( 'h3' );
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$css->add_property( 'font-family', $h3_family );
|
||||
$css->add_property( 'font-weight', $font_settings['heading_3_weight'] );
|
||||
$css->add_property( 'text-transform', $font_settings['heading_3_transform'] );
|
||||
$css->add_property( 'font-size', absint( $font_settings['heading_3_font_size'] ), false, 'px' );
|
||||
$css->add_property( 'line-height', floatval( $font_settings['heading_3_line_height'] ), false, 'em' );
|
||||
$css->add_property( 'margin-bottom', floatval( $font_settings['heading_3_margin_bottom'] ), false, 'px' );
|
||||
$css->add_property( 'margin-top', '0' );
|
||||
}
|
||||
|
||||
$css->add_property( 'color', $color_settings['h3_color'] );
|
||||
|
||||
$css->set_selector( 'h4' );
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$css->add_property( 'font-family', $h4_family );
|
||||
$css->add_property( 'font-weight', $font_settings['heading_4_weight'] );
|
||||
$css->add_property( 'text-transform', $font_settings['heading_4_transform'] );
|
||||
$css->add_property( 'margin-bottom', '20px' );
|
||||
$css->add_property( 'margin-top', '0' );
|
||||
|
||||
if ( '' !== $font_settings['heading_4_font_size'] ) {
|
||||
$css->add_property( 'font-size', absint( $font_settings['heading_4_font_size'] ), false, 'px' );
|
||||
} else {
|
||||
$css->add_property( 'font-size', 'inherit' );
|
||||
}
|
||||
|
||||
if ( '' !== $font_settings['heading_4_line_height'] ) {
|
||||
$css->add_property( 'line-height', floatval( $font_settings['heading_4_line_height'] ), false, 'em' );
|
||||
}
|
||||
}
|
||||
|
||||
$css->add_property( 'color', $color_settings['h4_color'] );
|
||||
|
||||
$css->set_selector( 'h5' );
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$css->add_property( 'font-family', $h5_family );
|
||||
$css->add_property( 'font-weight', $font_settings['heading_5_weight'] );
|
||||
$css->add_property( 'text-transform', $font_settings['heading_5_transform'] );
|
||||
$css->add_property( 'margin-bottom', '20px' );
|
||||
$css->add_property( 'margin-top', '0' );
|
||||
|
||||
if ( '' !== $font_settings['heading_5_font_size'] ) {
|
||||
$css->add_property( 'font-size', absint( $font_settings['heading_5_font_size'] ), false, 'px' );
|
||||
} else {
|
||||
$css->add_property( 'font-size', 'inherit' );
|
||||
}
|
||||
|
||||
if ( '' !== $font_settings['heading_5_line_height'] ) {
|
||||
$css->add_property( 'line-height', floatval( $font_settings['heading_5_line_height'] ), false, 'em' );
|
||||
}
|
||||
}
|
||||
|
||||
$css->add_property( 'color', $color_settings['h5_color'] );
|
||||
|
||||
$css->set_selector( 'h6' );
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$css->add_property( 'font-family', $h6_family );
|
||||
$css->add_property( 'font-weight', $font_settings['heading_6_weight'] );
|
||||
$css->add_property( 'text-transform', $font_settings['heading_6_transform'] );
|
||||
$css->add_property( 'margin-bottom', '20px' );
|
||||
$css->add_property( 'margin-top', '0' );
|
||||
|
||||
if ( '' !== $font_settings['heading_6_font_size'] ) {
|
||||
$css->add_property( 'font-size', absint( $font_settings['heading_6_font_size'] ), false, 'px' );
|
||||
} else {
|
||||
$css->add_property( 'font-size', 'inherit' );
|
||||
}
|
||||
|
||||
if ( '' !== $font_settings['heading_6_line_height'] ) {
|
||||
$css->add_property( 'line-height', floatval( $font_settings['heading_6_line_height'] ), false, 'em' );
|
||||
}
|
||||
}
|
||||
|
||||
$css->add_property( 'color', $color_settings['h6_color'] );
|
||||
|
||||
$css->set_selector( 'a.button, .block-editor-block-list__layout .wp-block-button .wp-block-button__link' );
|
||||
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
$css->add_property( 'font-family', $buttons_family );
|
||||
$css->add_property( 'font-weight', $font_settings['buttons_font_weight'] );
|
||||
$css->add_property( 'text-transform', $font_settings['buttons_font_transform'] );
|
||||
|
||||
if ( '' !== $font_settings['buttons_font_size'] ) {
|
||||
$css->add_property( 'font-size', absint( $font_settings['buttons_font_size'] ), false, 'px' );
|
||||
} else {
|
||||
$css->add_property( 'font-size', 'inherit' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( version_compare( $GLOBALS['wp_version'], '5.7-alpha.1', '>' ) ) {
|
||||
$css->set_selector( '.block-editor__container .edit-post-visual-editor' );
|
||||
$css->add_property( 'background-color', generate_get_option( 'background_color' ) );
|
||||
|
||||
$css->set_selector( 'body' );
|
||||
|
||||
if ( $color_settings['content_background_color'] ) {
|
||||
$css->add_property( 'background-color', $color_settings['content_background_color'] );
|
||||
} else {
|
||||
$css->add_property( 'background-color', generate_get_option( 'background_color' ) );
|
||||
}
|
||||
} else {
|
||||
$css->set_selector( 'body' );
|
||||
$css->add_property( 'background-color', generate_get_option( 'background_color' ) );
|
||||
|
||||
if ( $color_settings['content_background_color'] ) {
|
||||
$body_background = generate_get_option( 'background_color' );
|
||||
$content_background = $color_settings['content_background_color'];
|
||||
|
||||
$css->add_property( 'background', 'linear-gradient(' . $content_background . ',' . $content_background . '), linear-gradient(' . $body_background . ',' . $body_background . ')' );
|
||||
}
|
||||
}
|
||||
|
||||
$css->set_selector( 'a, a:visited' );
|
||||
|
||||
if ( $color_settings['content_link_color'] ) {
|
||||
$css->add_property( 'color', $color_settings['content_link_color'] );
|
||||
} else {
|
||||
$css->add_property( 'color', generate_get_option( 'link_color' ) );
|
||||
}
|
||||
|
||||
$css->set_selector( 'a:hover, a:focus, a:active' );
|
||||
|
||||
if ( $color_settings['content_link_hover_color'] ) {
|
||||
$css->add_property( 'color', $color_settings['content_link_hover_color'] );
|
||||
} else {
|
||||
$css->add_property( 'color', generate_get_option( 'link_color_hover' ) );
|
||||
}
|
||||
|
||||
return $css->css_output();
|
||||
}
|
@ -1,217 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Builds our dynamic CSS.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'GeneratePress_CSS' ) ) {
|
||||
/**
|
||||
* Creates minified css via PHP.
|
||||
*
|
||||
* @author Carlos Rios
|
||||
* Modified by Tom Usborne for GeneratePress
|
||||
*/
|
||||
class GeneratePress_CSS {
|
||||
|
||||
/**
|
||||
* The css selector that you're currently adding rules to
|
||||
*
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $_selector = ''; // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore
|
||||
|
||||
/**
|
||||
* Stores the final css output with all of its rules for the current selector.
|
||||
*
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $_selector_output = ''; // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore
|
||||
|
||||
/**
|
||||
* Stores all of the rules that will be added to the selector
|
||||
*
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $_css = ''; // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore
|
||||
|
||||
/**
|
||||
* The string that holds all of the css to output
|
||||
*
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $_output = ''; // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore
|
||||
|
||||
/**
|
||||
* Stores media queries
|
||||
*
|
||||
* @var null
|
||||
*/
|
||||
protected $_media_query = null; // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore
|
||||
|
||||
/**
|
||||
* The string that holds all of the css to output inside of the media query
|
||||
*
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
protected $_media_query_output = ''; // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore
|
||||
|
||||
/**
|
||||
* Sets a selector to the object and changes the current selector to a new one
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0
|
||||
*
|
||||
* @param string $selector - the css identifier of the html that you wish to target.
|
||||
* @return $this
|
||||
*/
|
||||
public function set_selector( $selector = '' ) {
|
||||
// Render the css in the output string everytime the selector changes.
|
||||
if ( '' !== $this->_selector ) {
|
||||
$this->add_selector_rules_to_output();
|
||||
}
|
||||
|
||||
$this->_selector = $selector;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a css property with value to the css output
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0
|
||||
*
|
||||
* @param string $property The css property.
|
||||
* @param string $value The value to be placed with the property.
|
||||
* @param string $og_default Check to see if the value matches the default.
|
||||
* @param string $unit The unit for the value (px).
|
||||
* @return $this
|
||||
*/
|
||||
public function add_property( $property, $value, $og_default = false, $unit = false ) {
|
||||
// Setting font-size to 0 is rarely ever a good thing.
|
||||
if ( 'font-size' === $property && 0 === $value ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Add our unit to our value if it exists.
|
||||
if ( $unit && '' !== $unit && is_numeric( $value ) ) {
|
||||
$value = $value . $unit;
|
||||
if ( '' !== $og_default ) {
|
||||
$og_default = $og_default . $unit;
|
||||
}
|
||||
}
|
||||
|
||||
// If we don't have a value or our value is the same as our og default, bail.
|
||||
if ( ( empty( $value ) && ! is_numeric( $value ) ) || $og_default === $value ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->_css .= $property . ':' . $value . ';';
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a media query in the class
|
||||
*
|
||||
* @since 1.1
|
||||
* @param string $value The media query.
|
||||
* @return $this
|
||||
*/
|
||||
public function start_media_query( $value ) {
|
||||
// Add the current rules to the output.
|
||||
$this->add_selector_rules_to_output();
|
||||
|
||||
// Add any previous media queries to the output.
|
||||
if ( ! empty( $this->_media_query ) ) {
|
||||
$this->add_media_query_rules_to_output();
|
||||
}
|
||||
|
||||
// Set the new media query.
|
||||
$this->_media_query = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops using a media query.
|
||||
*
|
||||
* @see start_media_query()
|
||||
*
|
||||
* @since 1.1
|
||||
* @return $this
|
||||
*/
|
||||
public function stop_media_query() {
|
||||
return $this->start_media_query( null );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the current media query's rules to the class' output variable
|
||||
*
|
||||
* @since 1.1
|
||||
* @return $this
|
||||
*/
|
||||
private function add_media_query_rules_to_output() {
|
||||
if ( ! empty( $this->_media_query_output ) ) {
|
||||
$this->_output .= sprintf( '@media %1$s{%2$s}', $this->_media_query, $this->_media_query_output );
|
||||
|
||||
// Reset the media query output string.
|
||||
$this->_media_query_output = '';
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the current selector rules to the output variable
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function add_selector_rules_to_output() {
|
||||
if ( ! empty( $this->_css ) ) {
|
||||
$this->_selector_output = $this->_selector;
|
||||
$selector_output = sprintf( '%1$s{%2$s}', $this->_selector_output, $this->_css );
|
||||
|
||||
// Add our CSS to the output.
|
||||
if ( ! empty( $this->_media_query ) ) {
|
||||
$this->_media_query_output .= $selector_output;
|
||||
$this->_css = '';
|
||||
} else {
|
||||
$this->_output .= $selector_output;
|
||||
}
|
||||
|
||||
// Reset the css.
|
||||
$this->_css = '';
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the minified css in the $_output variable
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function css_output() {
|
||||
// Add current selector's rules to output.
|
||||
$this->add_selector_rules_to_output();
|
||||
|
||||
// Output minified css.
|
||||
return $this->_output;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,266 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Build our admin dashboard.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* This class adds HTML attributes to various theme elements.
|
||||
*/
|
||||
class GeneratePress_Dashboard {
|
||||
/**
|
||||
* Class instance.
|
||||
*
|
||||
* @access private
|
||||
* @var $instance Class instance.
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Initiator
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get started.
|
||||
*/
|
||||
public function __construct() {
|
||||
// Load our old dashboard if we're using an old version of GP Premium.
|
||||
if ( defined( 'GP_PREMIUM_VERSION' ) && version_compare( GP_PREMIUM_VERSION, '2.1.0-alpha.1', '<' ) ) {
|
||||
require_once get_template_directory() . '/inc/dashboard.php';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
add_action( 'admin_menu', array( $this, 'add_menu_item' ) );
|
||||
add_filter( 'admin_body_class', array( $this, 'set_admin_body_class' ) );
|
||||
add_action( 'in_admin_header', array( $this, 'add_header' ) );
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
||||
add_action( 'generate_admin_dashboard', array( $this, 'start_customizing' ) );
|
||||
add_action( 'generate_admin_dashboard', array( $this, 'go_pro' ), 15 );
|
||||
add_action( 'generate_admin_dashboard', array( $this, 'reset' ), 100 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add our dashboard menu item.
|
||||
*/
|
||||
public function add_menu_item() {
|
||||
add_theme_page(
|
||||
esc_html__( 'GeneratePress', 'generatepress' ),
|
||||
esc_html__( 'GeneratePress', 'generatepress' ),
|
||||
apply_filters( 'generate_dashboard_page_capability', 'edit_theme_options' ),
|
||||
'generate-options',
|
||||
array( $this, 'page' )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get our dashboard pages so we can style them.
|
||||
*/
|
||||
public static function get_pages() {
|
||||
return apply_filters(
|
||||
'generate_dashboard_screens',
|
||||
array(
|
||||
'appearance_page_generate-options',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a body class on GP dashboard pages.
|
||||
*
|
||||
* @param string $classes The existing classes.
|
||||
*/
|
||||
public function set_admin_body_class( $classes ) {
|
||||
$dashboard_pages = self::get_pages();
|
||||
$current_screen = get_current_screen();
|
||||
|
||||
if ( in_array( $current_screen->id, $dashboard_pages ) ) {
|
||||
$classes .= ' generate-dashboard-page';
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build our Dashboard header.
|
||||
*/
|
||||
public static function header() {
|
||||
?>
|
||||
<div class="generatepress-dashboard-header">
|
||||
<div class="generatepress-dashboard-header__title">
|
||||
<h1>
|
||||
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 600"><path d="M485.2 427.8l-99.1-46.2 15.8-34c5.6-11.9 8.8-24.3 10-36.7 3.3-33.7-9-67.3-33.2-91.1-8.9-8.7-19.3-16.1-31.3-21.7-11.9-5.6-24.3-8.8-36.7-10-33.7-3.3-67.4 9-91.1 33.2-8.7 8.9-16.1 19.3-21.7 31.3l-15.8 34-30.4 65.2c-.7 1.5-.1 3.3 1.5 4l65.2 30.4 34 15.8 34 15.8 68 31.7 74.7 34.8c-65 45.4-152.1 55.2-228.7 17.4C90.2 447.4 44.1 313.3 97.3 202.6c53.3-110.8 186-158.5 297.8-106.3 88.1 41.1 137.1 131.9 129.1 223.4-.1 1.3.6 2.4 1.7 3l65.6 30.6c1.8.8 3.9-.3 4.2-2.2 22.6-130.7-44-265.4-170.5-323.5-150.3-69-327-4.1-396.9 145.8-70 150.1-5.1 328.5 145.1 398.5 114.1 53.2 244.5 28.4 331.3-52.3 17.9-16.6 33.9-35.6 47.5-56.8 1-1.5.4-3.6-1.3-4.3l-65.7-30.7zm-235-109.6l15.8-34c8.8-18.8 31.1-26.9 49.8-18.1s26.9 31 18.1 49.8l-15.8 34-34-15.8-33.9-15.9z" fill="currentColor" /></svg>
|
||||
<?php echo esc_html( get_admin_page_title() ); ?>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<?php self::navigation(); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Build our Dashboard menu.
|
||||
*/
|
||||
public static function navigation() {
|
||||
$screen = get_current_screen();
|
||||
|
||||
$tabs = apply_filters(
|
||||
'generate_dashboard_tabs',
|
||||
array(
|
||||
'dashboard' => array(
|
||||
'name' => __( 'Dashboard', 'generatepress' ),
|
||||
'url' => admin_url( 'themes.php?page=generate-options' ),
|
||||
'class' => 'appearance_page_generate-options' === $screen->id ? 'active' : '',
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
if ( ! defined( 'GP_PREMIUM_VERSION' ) ) {
|
||||
$tabs['premium'] = array(
|
||||
'name' => __( 'Premium', 'generatepress' ),
|
||||
'url' => 'https://generatepress.com/premium',
|
||||
'class' => '',
|
||||
'external' => true,
|
||||
);
|
||||
}
|
||||
|
||||
$tabs['support'] = array(
|
||||
'name' => __( 'Support', 'generatepress' ),
|
||||
'url' => 'https://generatepress.com/support',
|
||||
'class' => '',
|
||||
'external' => true,
|
||||
);
|
||||
|
||||
$tabs['documentation'] = array(
|
||||
'name' => __( 'Documentation', 'generatepress' ),
|
||||
'url' => 'https://docs.generatepress.com',
|
||||
'class' => '',
|
||||
'external' => true,
|
||||
);
|
||||
?>
|
||||
<div class="generatepress-dashboard-header__navigation">
|
||||
<?php
|
||||
foreach ( $tabs as $tab ) {
|
||||
printf(
|
||||
'<a href="%1$s" class="%2$s"%4$s>%3$s</a>',
|
||||
esc_url( $tab['url'] ),
|
||||
esc_attr( $tab['class'] ),
|
||||
esc_html( $tab['name'] ),
|
||||
! empty( $tab['external'] ) ? 'target="_blank" rel="noreferrer noopener"' : ''
|
||||
);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Add our Dashboard headers.
|
||||
*/
|
||||
public function add_header() {
|
||||
$dashboard_pages = self::get_pages();
|
||||
$current_screen = get_current_screen();
|
||||
|
||||
if ( in_array( $current_screen->id, $dashboard_pages ) ) {
|
||||
self::header();
|
||||
|
||||
/**
|
||||
* generate_dashboard_after_header hook.
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
do_action( 'generate_dashboard_after_header' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add our scripts to the page.
|
||||
*/
|
||||
public function enqueue_scripts() {
|
||||
$dashboard_pages = self::get_pages();
|
||||
$current_screen = get_current_screen();
|
||||
|
||||
if ( in_array( $current_screen->id, $dashboard_pages ) ) {
|
||||
wp_enqueue_style(
|
||||
'generate-dashboard',
|
||||
get_template_directory_uri() . '/assets/dist/style-dashboard.css',
|
||||
array( 'wp-components' ),
|
||||
GENERATE_VERSION
|
||||
);
|
||||
|
||||
if ( 'appearance_page_generate-options' === $current_screen->id ) {
|
||||
wp_enqueue_script(
|
||||
'generate-dashboard',
|
||||
get_template_directory_uri() . '/assets/dist/dashboard.js',
|
||||
array( 'wp-api', 'wp-i18n', 'wp-components', 'wp-element', 'wp-api-fetch', 'wp-hooks', 'wp-polyfill' ),
|
||||
GENERATE_VERSION,
|
||||
true
|
||||
);
|
||||
|
||||
wp_set_script_translations( 'generate-dashboard', 'generatepress' );
|
||||
|
||||
wp_localize_script(
|
||||
'generate-dashboard',
|
||||
'generateDashboard',
|
||||
array(
|
||||
'hasPremium' => defined( 'GP_PREMIUM_VERSION' ),
|
||||
'customizeSectionUrls' => array(
|
||||
'siteIdentitySection' => add_query_arg( rawurlencode( 'autofocus[section]' ), 'title_tagline', wp_customize_url() ),
|
||||
'colorsSection' => add_query_arg( rawurlencode( 'autofocus[section]' ), 'generate_colors_section', wp_customize_url() ),
|
||||
'typographySection' => add_query_arg( rawurlencode( 'autofocus[section]' ), 'generate_typography_section', wp_customize_url() ),
|
||||
'layoutSection' => add_query_arg( rawurlencode( 'autofocus[panel]' ), 'generate_layout_panel', wp_customize_url() ),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the HTML for our page.
|
||||
*/
|
||||
public function page() {
|
||||
?>
|
||||
<div class="wrap">
|
||||
<div class="generatepress-dashboard">
|
||||
<?php do_action( 'generate_admin_dashboard' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the container for our start customizing app.
|
||||
*/
|
||||
public function start_customizing() {
|
||||
echo '<div id="generatepress-dashboard-app"></div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the container for our start customizing app.
|
||||
*/
|
||||
public function go_pro() {
|
||||
echo '<div id="generatepress-dashboard-go-pro"></div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the container for our reset app.
|
||||
*/
|
||||
public function reset() {
|
||||
echo '<div id="generatepress-reset"></div>';
|
||||
}
|
||||
}
|
||||
|
||||
GeneratePress_Dashboard::get_instance();
|
@ -1,495 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Add HTML attributes to our theme elements.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* This class adds HTML attributes to various theme elements.
|
||||
*/
|
||||
class GeneratePress_HTML_Attributes {
|
||||
/**
|
||||
* Class instance.
|
||||
*
|
||||
* @access private
|
||||
* @var $instance Class instance.
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Initiator
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
add_filter( 'generate_parse_attr', array( $this, 'parse_attributes' ), 10, 3 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the attributes.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The current attributes.
|
||||
* @param string $context The context in which attributes are applied.
|
||||
* @param array $settings Custom settings passed to the filter.
|
||||
*/
|
||||
public function parse_attributes( $attributes, $context, $settings ) {
|
||||
switch ( $context ) {
|
||||
case 'top-bar':
|
||||
return $this->top_bar( $attributes );
|
||||
|
||||
case 'inside-top-bar':
|
||||
return $this->inside_top_bar( $attributes );
|
||||
|
||||
case 'header':
|
||||
return $this->site_header( $attributes );
|
||||
|
||||
case 'inside-header':
|
||||
return $this->inside_site_header( $attributes );
|
||||
|
||||
case 'menu-toggle':
|
||||
return $this->menu_toggle( $attributes );
|
||||
|
||||
case 'navigation':
|
||||
return $this->primary_navigation( $attributes );
|
||||
|
||||
case 'inside-navigation':
|
||||
return $this->primary_inner_navigation( $attributes );
|
||||
|
||||
case 'mobile-menu-control-wrapper':
|
||||
return $this->mobile_menu_control_wrapper( $attributes );
|
||||
|
||||
case 'site-info':
|
||||
return $this->site_info( $attributes );
|
||||
|
||||
case 'inside-site-info':
|
||||
return $this->inside_site_info( $attributes );
|
||||
|
||||
case 'entry-header':
|
||||
return $this->entry_header( $attributes );
|
||||
|
||||
case 'page-header':
|
||||
return $this->page_header( $attributes );
|
||||
|
||||
case 'site-content':
|
||||
return $this->site_content( $attributes );
|
||||
|
||||
case 'page':
|
||||
return $this->page( $attributes );
|
||||
|
||||
case 'content':
|
||||
return $this->content( $attributes );
|
||||
|
||||
case 'main':
|
||||
return $this->main( $attributes );
|
||||
|
||||
case 'post-navigation':
|
||||
return $this->post_navigation( $attributes );
|
||||
|
||||
case 'left-sidebar':
|
||||
return $this->left_sidebar( $attributes );
|
||||
|
||||
case 'right-sidebar':
|
||||
return $this->right_sidebar( $attributes );
|
||||
|
||||
case 'footer-widgets-container':
|
||||
return $this->footer_widgets_container( $attributes );
|
||||
|
||||
case 'comment-body':
|
||||
return $this->comment_body( $attributes, $settings );
|
||||
|
||||
case 'comment-meta':
|
||||
return $this->comment_meta( $attributes );
|
||||
|
||||
case 'footer-entry-meta':
|
||||
return $this->footer_entry_meta( $attributes );
|
||||
|
||||
case 'woocommerce-content':
|
||||
return $this->woocommerce_content( $attributes );
|
||||
}
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our top bar.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function top_bar( $attributes ) {
|
||||
$classes = generate_get_element_classes( 'top_bar' );
|
||||
|
||||
if ( $classes ) {
|
||||
$attributes['class'] .= ' ' . join( ' ', $classes );
|
||||
}
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our inside top bar container.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function inside_top_bar( $attributes ) {
|
||||
$attributes['class'] .= ' inside-top-bar';
|
||||
|
||||
if ( 'contained' === generate_get_option( 'top_bar_inner_width' ) ) {
|
||||
$attributes['class'] .= ' grid-container';
|
||||
|
||||
if ( ! generate_is_using_flexbox() ) {
|
||||
$attributes['class'] .= ' grid-parent';
|
||||
}
|
||||
}
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our site header.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function site_header( $attributes ) {
|
||||
$attributes['id'] = 'masthead';
|
||||
$attributes['aria-label'] = esc_attr__( 'Site', 'generatepress' );
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our inside site header container.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function inside_site_header( $attributes ) {
|
||||
$classes = generate_get_element_classes( 'inside_header' );
|
||||
|
||||
if ( $classes ) {
|
||||
$attributes['class'] .= ' ' . join( ' ', $classes );
|
||||
}
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our menu toggle.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function menu_toggle( $attributes ) {
|
||||
$attributes['class'] .= ' menu-toggle';
|
||||
$attributes['aria-controls'] = 'primary-menu';
|
||||
$attributes['aria-expanded'] = 'false';
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our main navigation.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function primary_navigation( $attributes ) {
|
||||
$attributes['id'] = 'site-navigation';
|
||||
$attributes['aria-label'] = esc_attr__( 'Primary', 'generatepress' );
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our main navigation.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function primary_inner_navigation( $attributes ) {
|
||||
$classes = generate_get_element_classes( 'inside_navigation' );
|
||||
|
||||
if ( $classes ) {
|
||||
$attributes['class'] .= ' ' . join( ' ', $classes );
|
||||
}
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our main navigation.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function mobile_menu_control_wrapper( $attributes ) {
|
||||
$attributes['id'] = 'mobile-menu-control-wrapper';
|
||||
$attributes['class'] .= ' main-navigation mobile-menu-control-wrapper';
|
||||
$attributes['aria-label'] = esc_attr__( 'Mobile Toggle', 'generatepress' );
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our footer element.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function site_info( $attributes ) {
|
||||
$attributes['class'] .= ' site-info';
|
||||
$attributes['aria-label'] = esc_attr__( 'Site', 'generatepress' );
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our inside site info container.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function inside_site_info( $attributes ) {
|
||||
$attributes['class'] .= ' inside-site-info';
|
||||
|
||||
if ( 'full-width' !== generate_get_option( 'footer_inner_width' ) ) {
|
||||
$attributes['class'] .= ' grid-container';
|
||||
|
||||
if ( ! generate_is_using_flexbox() ) {
|
||||
$attributes['class'] .= ' grid-parent';
|
||||
}
|
||||
}
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our entry headers.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function entry_header( $attributes ) {
|
||||
$attributes['class'] .= ' entry-header';
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our page headers.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function page_header( $attributes ) {
|
||||
$attributes['class'] .= ' page-header';
|
||||
$attributes['aria-label'] = esc_attr__( 'Page', 'generatepress' );
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our entry headers.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function post_navigation( $attributes ) {
|
||||
if ( is_single() ) {
|
||||
$attributes['class'] .= ' post-navigation';
|
||||
$attributes['aria-label'] = esc_attr__( 'Posts', 'generatepress' );
|
||||
} else {
|
||||
$attributes['class'] .= ' paging-navigation';
|
||||
$attributes['aria-label'] = esc_attr__( 'Archive Page', 'generatepress' );
|
||||
}
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our page container.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function page( $attributes ) {
|
||||
$attributes['id'] = 'page';
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our site content container.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function site_content( $attributes ) {
|
||||
$attributes['id'] = 'content';
|
||||
$attributes['class'] .= ' site-content';
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our primary content container.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function content( $attributes ) {
|
||||
$attributes['id'] = 'primary';
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our primary content container.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function main( $attributes ) {
|
||||
$attributes['id'] = 'main';
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our left sidebar.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function left_sidebar( $attributes ) {
|
||||
$classes = generate_get_element_classes( 'left_sidebar' );
|
||||
|
||||
if ( $classes ) {
|
||||
$attributes['class'] .= ' ' . join( ' ', $classes );
|
||||
}
|
||||
|
||||
$attributes['id'] = 'left-sidebar';
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our right sidebar.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function right_sidebar( $attributes ) {
|
||||
$classes = generate_get_element_classes( 'right_sidebar' );
|
||||
|
||||
if ( $classes ) {
|
||||
$attributes['class'] .= ' ' . join( ' ', $classes );
|
||||
}
|
||||
|
||||
$attributes['id'] = 'right-sidebar';
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our footer widget inner container.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function footer_widgets_container( $attributes ) {
|
||||
$classes = generate_get_element_classes( 'inside_footer' );
|
||||
|
||||
if ( $classes ) {
|
||||
$attributes['class'] .= ' ' . join( ' ', $classes );
|
||||
}
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our footer widget inner container.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
* @param array $settings Settings passed through the function.
|
||||
*/
|
||||
public function comment_body( $attributes, $settings ) {
|
||||
$attributes['class'] .= ' comment-body';
|
||||
$attributes['id'] = 'div-comment-' . $settings['comment-id'];
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our comment meta.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function comment_meta( $attributes ) {
|
||||
$attributes['class'] .= ' comment-meta';
|
||||
$attributes['aria-label'] = esc_attr__( 'Comment meta', 'generatepress' );
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our footer entry meta.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function footer_entry_meta( $attributes ) {
|
||||
$attributes['class'] .= ' entry-meta';
|
||||
$attributes['aria-label'] = esc_attr__( 'Entry meta', 'generatepress' );
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add attributes to our WooCommerce content container.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @param array $attributes The existing attributes.
|
||||
*/
|
||||
public function woocommerce_content( $attributes ) {
|
||||
if ( is_singular() ) {
|
||||
$attributes['id'] = 'post-' . get_the_ID();
|
||||
$attributes['class'] = esc_attr( implode( ' ', get_post_class( '', get_the_ID() ) ) );
|
||||
|
||||
if ( 'microdata' === generate_get_schema_type() ) {
|
||||
$type = apply_filters( 'generate_article_itemtype', 'CreativeWork' );
|
||||
|
||||
$attributes['itemtype'] = sprintf(
|
||||
'https://schema.org/%s',
|
||||
$type
|
||||
);
|
||||
|
||||
$attributes['itemscope'] = true;
|
||||
}
|
||||
} else {
|
||||
$attributes['class'] = 'woocommerce-archive-wrapper';
|
||||
}
|
||||
|
||||
return $attributes;
|
||||
}
|
||||
}
|
||||
|
||||
GeneratePress_HTML_Attributes::get_instance();
|
@ -1,151 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Rest API functions
|
||||
*
|
||||
* @package GenerateBlocks
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class GenerateBlocks_Rest
|
||||
*/
|
||||
class GeneratePress_Rest extends WP_REST_Controller {
|
||||
/**
|
||||
* Instance.
|
||||
*
|
||||
* @access private
|
||||
* @var object Instance
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Namespace.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $namespace = 'generatepress/v';
|
||||
|
||||
/**
|
||||
* Version.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $version = '1';
|
||||
|
||||
/**
|
||||
* Initiator.
|
||||
*
|
||||
* @return object initialized object of class.
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* GeneratePress_Rest constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
add_action( 'rest_api_init', array( $this, 'register_routes' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register rest routes.
|
||||
*/
|
||||
public function register_routes() {
|
||||
$namespace = $this->namespace . $this->version;
|
||||
|
||||
register_rest_route(
|
||||
$namespace,
|
||||
'/reset/',
|
||||
array(
|
||||
'methods' => WP_REST_Server::EDITABLE,
|
||||
'callback' => array( $this, 'reset' ),
|
||||
'permission_callback' => array( $this, 'update_settings_permission' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get edit options permissions.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function update_settings_permission() {
|
||||
return current_user_can( 'manage_options' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset settings.
|
||||
*
|
||||
* @param WP_REST_Request $request request object.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function reset( WP_REST_Request $request ) {
|
||||
delete_option( 'generate_settings' );
|
||||
delete_option( 'generate_dynamic_css_output' );
|
||||
delete_option( 'generate_dynamic_css_cached_version' );
|
||||
|
||||
return $this->success( __( 'Settings reset.', 'generatepress' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Success rest.
|
||||
*
|
||||
* @param mixed $response response data.
|
||||
* @return mixed
|
||||
*/
|
||||
public function success( $response ) {
|
||||
return new WP_REST_Response(
|
||||
array(
|
||||
'success' => true,
|
||||
'response' => $response,
|
||||
),
|
||||
200
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Failed rest.
|
||||
*
|
||||
* @param mixed $response response data.
|
||||
* @return mixed
|
||||
*/
|
||||
public function failed( $response ) {
|
||||
return new WP_REST_Response(
|
||||
array(
|
||||
'success' => false,
|
||||
'response' => $response,
|
||||
),
|
||||
200
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Error rest.
|
||||
*
|
||||
* @param mixed $code error code.
|
||||
* @param mixed $response response data.
|
||||
* @return mixed
|
||||
*/
|
||||
public function error( $code, $response ) {
|
||||
return new WP_REST_Response(
|
||||
array(
|
||||
'error' => true,
|
||||
'success' => false,
|
||||
'error_code' => $code,
|
||||
'response' => $response,
|
||||
),
|
||||
401
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
GeneratePress_Rest::get_instance();
|
@ -1,408 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Migrates old options on update.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* Process option updates if necessary.
|
||||
*/
|
||||
class GeneratePress_Theme_Update {
|
||||
/**
|
||||
* Class instance.
|
||||
*
|
||||
* @access private
|
||||
* @var $instance Class instance.
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Initiator
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
if ( is_admin() ) {
|
||||
add_action( 'admin_init', __CLASS__ . '::init', 5 );
|
||||
} else {
|
||||
add_action( 'wp', __CLASS__ . '::init', 5 );
|
||||
}
|
||||
|
||||
add_action( 'admin_init', __CLASS__ . '::admin_updates', 1 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement theme update logic. Only run updates on existing sites.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public static function init() {
|
||||
if ( is_customize_preview() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$saved_version = get_option( 'generate_db_version', false );
|
||||
|
||||
if ( false === $saved_version ) {
|
||||
// Typically this would mean this is a new install, but we haven't always had the version saved, so we need to check for existing settings.
|
||||
|
||||
$existing_settings = get_option( 'generate_settings', array() );
|
||||
|
||||
// Can't count this as a user-set option since a previous migration script set it.
|
||||
if ( isset( $existing_settings['combine_css'] ) ) {
|
||||
unset( $existing_settings['combine_css'] );
|
||||
}
|
||||
|
||||
if ( ! empty( $existing_settings ) ) {
|
||||
// We have settings, which means this is an old install with no version number.
|
||||
$saved_version = '2.0';
|
||||
} else {
|
||||
// No settings and no saved version, must be a new install.
|
||||
|
||||
if ( 'admin_init' === current_action() ) {
|
||||
// If we're in the admin, add our version to the database.
|
||||
update_option( 'generate_db_version', GENERATE_VERSION );
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( version_compare( $saved_version, GENERATE_VERSION, '=' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( version_compare( $saved_version, '2.3.0', '<' ) ) {
|
||||
self::v_2_3_0();
|
||||
}
|
||||
|
||||
if ( version_compare( $saved_version, '3.0.0-alpha.1', '<' ) ) {
|
||||
self::v_3_0_0();
|
||||
}
|
||||
|
||||
if ( version_compare( $saved_version, '3.1.0-alpha.1', '<' ) ) {
|
||||
self::v_3_1_0();
|
||||
}
|
||||
|
||||
// Delete our CSS cache.
|
||||
delete_option( 'generate_dynamic_css_output' );
|
||||
delete_option( 'generate_dynamic_css_cached_version' );
|
||||
|
||||
// Reset our dynamic CSS file updated time so it regenerates.
|
||||
$dynamic_css_data = get_option( 'generatepress_dynamic_css_data', array() );
|
||||
|
||||
if ( ! empty( $dynamic_css_data ) ) {
|
||||
if ( isset( $dynamic_css_data['updated_time'] ) ) {
|
||||
unset( $dynamic_css_data['updated_time'] );
|
||||
}
|
||||
|
||||
update_option( 'generatepress_dynamic_css_data', $dynamic_css_data );
|
||||
}
|
||||
|
||||
// Last thing to do is update our version.
|
||||
update_option( 'generate_db_version', GENERATE_VERSION );
|
||||
}
|
||||
|
||||
/**
|
||||
* Less important updates that should only happen in the Dashboard.
|
||||
* These use a database flag instead of our version number for legacy reasons.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public static function admin_updates() {
|
||||
self::v_1_3_0();
|
||||
self::v_1_3_29();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove variants from font family values.
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
public static function v_1_3_0() {
|
||||
// Don't run this if Typography add-on is activated.
|
||||
if ( function_exists( 'generate_fonts_customize_register' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$settings = get_option( 'generate_settings', array() );
|
||||
|
||||
if ( ! isset( $settings['font_body'] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$value = $settings['font_body'];
|
||||
$needs_update = false;
|
||||
|
||||
// If our value has : in it.
|
||||
if ( ! empty( $value ) && strpos( $value, ':' ) !== false ) {
|
||||
// Remove the : and anything past it.
|
||||
$value = current( explode( ':', $value ) );
|
||||
|
||||
$settings['font_body'] = $value;
|
||||
$needs_update = true;
|
||||
}
|
||||
|
||||
if ( $needs_update ) {
|
||||
update_option( 'generate_settings', $settings );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Move logo to custom_logo option as required by WP.org.
|
||||
*
|
||||
* @since 1.3.29
|
||||
*/
|
||||
public static function v_1_3_29() {
|
||||
if ( ! function_exists( 'the_custom_logo' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( get_theme_mod( 'custom_logo' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$settings = get_option( 'generate_settings', array() );
|
||||
|
||||
if ( ! isset( $settings['logo'] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$old_value = $settings['logo'];
|
||||
|
||||
if ( empty( $old_value ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$logo = attachment_url_to_postid( $old_value );
|
||||
|
||||
if ( is_int( $logo ) ) {
|
||||
set_theme_mod( 'custom_logo', $logo );
|
||||
}
|
||||
|
||||
if ( get_theme_mod( 'custom_logo' ) ) {
|
||||
$settings['logo'] = '';
|
||||
update_option( 'generate_settings', $settings );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn off the combine CSS option for existing sites.
|
||||
*
|
||||
* @since 2.3.0
|
||||
*/
|
||||
public static function v_2_3_0() {
|
||||
$settings = get_option( 'generate_settings', array() );
|
||||
$update_options = false;
|
||||
|
||||
if ( ! isset( $settings['combine_css'] ) ) {
|
||||
$settings['combine_css'] = false;
|
||||
$update_options = true;
|
||||
}
|
||||
|
||||
if ( $update_options ) {
|
||||
update_option( 'generate_settings', $settings );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update sites using old defaults.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public static function v_3_0_0() {
|
||||
$settings = get_option( 'generate_settings', array() );
|
||||
$update_options = false;
|
||||
|
||||
$old_defaults = array(
|
||||
'icons' => 'font',
|
||||
'structure' => 'floats',
|
||||
'hide_tagline' => '',
|
||||
'container_width' => '1100',
|
||||
'nav_position_setting' => 'nav-below-header',
|
||||
'container_alignment' => 'boxes',
|
||||
'background_color' => '#efefef',
|
||||
'text_color' => '#3a3a3a',
|
||||
'header_text_color' => '#3a3a3a',
|
||||
'header_link_color' => '#3a3a3a',
|
||||
'navigation_background_color' => '#222222',
|
||||
'navigation_text_color' => '#ffffff',
|
||||
'navigation_background_hover_color' => '#3f3f3f',
|
||||
'navigation_text_hover_color' => '#ffffff',
|
||||
'navigation_background_current_color' => '#3f3f3f',
|
||||
'navigation_text_current_color' => '#ffffff',
|
||||
'subnavigation_background_color' => '#3f3f3f',
|
||||
'subnavigation_text_color' => '#ffffff',
|
||||
'subnavigation_background_hover_color' => '#4f4f4f',
|
||||
'subnavigation_text_hover_color' => '#ffffff',
|
||||
'subnavigation_background_current_color' => '#4f4f4f',
|
||||
'subnavigation_text_current_color' => '#ffffff',
|
||||
'sidebar_widget_title_color' => '#000000',
|
||||
'site_title_font_size' => '45',
|
||||
'mobile_site_title_font_size' => '30',
|
||||
'form_button_background_color' => '#666666',
|
||||
'form_button_background_color_hover' => '#3f3f3f',
|
||||
'footer_background_color' => '#222222',
|
||||
'footer_link_hover_color' => '#606060',
|
||||
'entry_meta_link_color' => '#595959',
|
||||
'entry_meta_link_color_hover' => '#1e73be',
|
||||
'blog_post_title_color' => '',
|
||||
'blog_post_title_hover_color' => '',
|
||||
'heading_1_font_size' => '40',
|
||||
'mobile_heading_1_font_size' => '30',
|
||||
'heading_1_weight' => '300',
|
||||
'heading_2_font_size' => '30',
|
||||
'mobile_heading_2_font_size' => '25',
|
||||
'heading_2_weight' => '300',
|
||||
'heading_3_font_size' => '20',
|
||||
'mobile_heading_3_font_size' => '',
|
||||
'heading_4_font_size' => '',
|
||||
'mobile_heading_4_font_size' => '',
|
||||
'heading_5_font_size' => '',
|
||||
'mobile_heading_5_font_size' => '',
|
||||
);
|
||||
|
||||
foreach ( $old_defaults as $key => $value ) {
|
||||
if ( ! isset( $settings[ $key ] ) ) {
|
||||
$settings[ $key ] = $value;
|
||||
$update_options = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $update_options ) {
|
||||
update_option( 'generate_settings', $settings );
|
||||
}
|
||||
|
||||
$spacing_settings = get_option( 'generate_spacing_settings', array() );
|
||||
$update_spacing_options = false;
|
||||
|
||||
$old_spacing_defaults = array(
|
||||
'left_sidebar_width' => '25',
|
||||
'right_sidebar_width' => '25',
|
||||
'top_bar_right' => '10',
|
||||
'top_bar_left' => '10',
|
||||
'mobile_top_bar_right' => '',
|
||||
'mobile_top_bar_left' => '',
|
||||
'header_top' => '40',
|
||||
'header_bottom' => '40',
|
||||
'mobile_header_right' => '',
|
||||
'mobile_header_left' => '',
|
||||
'mobile_widget_top' => '',
|
||||
'mobile_widget_right' => '',
|
||||
'mobile_widget_bottom' => '',
|
||||
'mobile_widget_left' => '',
|
||||
'mobile_footer_widget_container_top' => '',
|
||||
'mobile_footer_widget_container_right' => '',
|
||||
'mobile_footer_widget_container_bottom' => '',
|
||||
'mobile_footer_widget_container_left' => '',
|
||||
'footer_right' => '20',
|
||||
'footer_left' => '20',
|
||||
'mobile_footer_right' => '10',
|
||||
'mobile_footer_left' => '10',
|
||||
);
|
||||
|
||||
foreach ( $old_spacing_defaults as $key => $value ) {
|
||||
if ( ! isset( $spacing_settings[ $key ] ) ) {
|
||||
$spacing_settings[ $key ] = $value;
|
||||
$update_spacing_options = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $update_spacing_options ) {
|
||||
update_option( 'generate_spacing_settings', $spacing_settings );
|
||||
}
|
||||
|
||||
if ( $update_options || $update_spacing_options ) {
|
||||
delete_option( 'generate_dynamic_css_output' );
|
||||
delete_option( 'generate_dynamic_css_cached_version' );
|
||||
|
||||
// Reset our dynamic CSS file updated time so it regenerates.
|
||||
$dynamic_css_data = get_option( 'generatepress_dynamic_css_data', array() );
|
||||
|
||||
if ( ! empty( $dynamic_css_data ) ) {
|
||||
if ( isset( $dynamic_css_data['updated_time'] ) ) {
|
||||
unset( $dynamic_css_data['updated_time'] );
|
||||
}
|
||||
|
||||
update_option( 'generatepress_dynamic_css_data', $dynamic_css_data );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update sites using old defaults.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*/
|
||||
public static function v_3_1_0() {
|
||||
$settings = get_option( 'generate_settings', array() );
|
||||
$update_options = false;
|
||||
|
||||
$old_defaults = array(
|
||||
'underline_links' => 'never',
|
||||
'use_dynamic_typography' => false,
|
||||
'background_color' => '#f7f8f9',
|
||||
'text_color' => '#222222',
|
||||
'link_color' => '#1e73be',
|
||||
'link_color_hover' => '#000000',
|
||||
'header_background_color' => '#ffffff',
|
||||
'site_title_color' => '#222222',
|
||||
'site_tagline_color' => '#757575',
|
||||
'navigation_background_color' => '#ffffff',
|
||||
'navigation_background_hover_color' => '#ffffff',
|
||||
'navigation_background_current_color' => '#ffffff',
|
||||
'navigation_text_color' => '#515151',
|
||||
'navigation_text_hover_color' => '#7a8896',
|
||||
'navigation_text_current_color' => '#7a8896',
|
||||
'subnavigation_background_color' => '#eaeaea',
|
||||
'subnavigation_background_hover_color' => '#eaeaea',
|
||||
'subnavigation_background_current_color' => '#eaeaea',
|
||||
'subnavigation_text_color' => '#515151',
|
||||
'subnavigation_text_hover_color' => '#7a8896',
|
||||
'subnavigation_text_current_color' => '#7a8896',
|
||||
'content_background_color' => '#ffffff',
|
||||
'blog_post_title_color' => '#222222',
|
||||
'blog_post_title_hover_color' => '#55555e',
|
||||
'entry_meta_text_color' => '#595959',
|
||||
'sidebar_widget_background_color' => '#ffffff',
|
||||
'footer_widget_background_color' => '#ffffff',
|
||||
'footer_widget_title_color' => '#000000',
|
||||
'footer_background_color' => '#55555e',
|
||||
'footer_text_color' => '#ffffff',
|
||||
'footer_link_color' => '#ffffff',
|
||||
'footer_link_hover_color' => '#d3d3d3',
|
||||
'form_background_color' => '#fafafa',
|
||||
'form_text_color' => '#666666',
|
||||
'form_background_color_focus' => '#ffffff',
|
||||
'form_text_color_focus' => '#666666',
|
||||
'form_border_color' => '#cccccc',
|
||||
'form_border_color_focus' => '#bfbfbf',
|
||||
);
|
||||
|
||||
foreach ( $old_defaults as $key => $value ) {
|
||||
if ( ! isset( $settings[ $key ] ) ) {
|
||||
$settings[ $key ] = $value;
|
||||
$update_options = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $update_options ) {
|
||||
update_option( 'generate_settings', $settings );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GeneratePress_Theme_Update::get_instance();
|
@ -1,306 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* This file handles typography migration.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles all of our typography migration.
|
||||
*/
|
||||
class GeneratePress_Typography_Migration {
|
||||
/**
|
||||
* Class instance.
|
||||
*
|
||||
* @access private
|
||||
* @var $instance Class instance.
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Initiator
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Map our new typography keys to the old prefixes.
|
||||
*/
|
||||
public static function get_option_prefixes() {
|
||||
$data = array(
|
||||
array(
|
||||
'selector' => 'body',
|
||||
'legacy_prefix' => 'body',
|
||||
'group' => 'base',
|
||||
'module' => 'core',
|
||||
),
|
||||
array(
|
||||
'selector' => 'top-bar',
|
||||
'legacy_prefix' => 'top_bar',
|
||||
'group' => 'widgets',
|
||||
'module' => 'core',
|
||||
),
|
||||
array(
|
||||
'selector' => 'main-title',
|
||||
'legacy_prefix' => 'site_title',
|
||||
'group' => 'header',
|
||||
'module' => 'core',
|
||||
),
|
||||
array(
|
||||
'selector' => 'site-description',
|
||||
'legacy_prefix' => 'site_tagline',
|
||||
'group' => 'header',
|
||||
'module' => 'core',
|
||||
),
|
||||
array(
|
||||
'selector' => 'primary-menu-items',
|
||||
'legacy_prefix' => 'navigation',
|
||||
'group' => 'primaryNavigation',
|
||||
'module' => 'core',
|
||||
),
|
||||
array(
|
||||
'selector' => 'widget-titles',
|
||||
'legacy_prefix' => 'widget_title',
|
||||
'group' => 'widgets',
|
||||
'module' => 'core',
|
||||
),
|
||||
array(
|
||||
'selector' => 'buttons',
|
||||
'legacy_prefix' => 'buttons',
|
||||
'group' => 'content',
|
||||
'module' => 'core',
|
||||
),
|
||||
array(
|
||||
'selector' => 'single-content-title',
|
||||
'legacy_prefix' => 'single_post_title',
|
||||
'group' => 'content',
|
||||
'module' => 'core',
|
||||
),
|
||||
array(
|
||||
'selector' => 'archive-content-title',
|
||||
'legacy_prefix' => 'archive_post_title',
|
||||
'group' => 'content',
|
||||
'module' => 'core',
|
||||
),
|
||||
array(
|
||||
'selector' => 'footer',
|
||||
'legacy_prefix' => 'footer',
|
||||
'group' => 'footer',
|
||||
'module' => 'core',
|
||||
),
|
||||
);
|
||||
|
||||
$headings = array(
|
||||
'h1' => 'heading_1',
|
||||
'h2' => 'heading_2',
|
||||
'h3' => 'heading_3',
|
||||
'h4' => 'heading_4',
|
||||
'h5' => 'heading_5',
|
||||
'h6' => 'heading_6',
|
||||
);
|
||||
|
||||
foreach ( $headings as $selector => $legacy_prefix ) {
|
||||
$data[] = array(
|
||||
'selector' => $selector,
|
||||
'legacy_prefix' => $legacy_prefix,
|
||||
'group' => 'content',
|
||||
'module' => 'core',
|
||||
);
|
||||
}
|
||||
|
||||
if ( function_exists( 'generate_secondary_nav_typography_selectors' ) ) {
|
||||
$data[] = array(
|
||||
'selector' => 'secondary-nav-menu-items',
|
||||
'legacy_prefix' => 'secondary_navigation',
|
||||
'group' => 'secondaryNavigation',
|
||||
'module' => 'secondary-nav',
|
||||
);
|
||||
}
|
||||
|
||||
if ( function_exists( 'generate_menu_plus_typography_selectors' ) ) {
|
||||
$data[] = array(
|
||||
'selector' => 'off-canvas-panel-menu-items',
|
||||
'legacy_prefix' => 'slideout',
|
||||
'group' => 'offCanvasPanel',
|
||||
'module' => 'off-canvas-panel',
|
||||
);
|
||||
}
|
||||
|
||||
if ( function_exists( 'generate_woocommerce_typography_selectors' ) ) {
|
||||
$data[] = array(
|
||||
'selector' => 'woocommerce-catalog-product-titles',
|
||||
'legacy_prefix' => 'wc_product_title',
|
||||
'group' => 'wooCommerce',
|
||||
'module' => 'woocommerce',
|
||||
);
|
||||
|
||||
$data[] = array(
|
||||
'selector' => 'woocommerce-related-product-titles',
|
||||
'legacy_prefix' => 'wc_related_product_title',
|
||||
'group' => 'wooCommerce',
|
||||
'module' => 'woocommerce',
|
||||
);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if we have a saved value.
|
||||
*
|
||||
* @param string $id The option ID.
|
||||
* @param array $settings The saved settings.
|
||||
* @param array $defaults The defaults.
|
||||
*/
|
||||
public static function has_saved_value( $id, $settings, $defaults ) {
|
||||
return isset( $settings[ $id ] )
|
||||
&& isset( $defaults[ $id ] )
|
||||
&& $defaults[ $id ] !== $settings[ $id ] // Need this because the Customizer treats defaults as saved values.
|
||||
&& (
|
||||
! empty( $settings[ $id ] )
|
||||
|| 0 === $settings[ $id ]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all of our mapped typography data.
|
||||
*/
|
||||
public static function get_mapped_typography_data() {
|
||||
$settings = get_option( 'generate_settings', array() );
|
||||
$defaults = generate_get_default_fonts();
|
||||
$typography_mapping = array();
|
||||
|
||||
// These options don't have "font" in their IDs.
|
||||
$no_font_in_ids = array(
|
||||
'single_post_title',
|
||||
'archive_post_title',
|
||||
);
|
||||
|
||||
for ( $headings = 1; $headings < 7; $headings++ ) {
|
||||
$no_font_in_ids[] = 'heading_' . $headings;
|
||||
}
|
||||
|
||||
foreach ( self::get_option_prefixes() as $key => $data ) {
|
||||
$legacy_setting_ids = array(
|
||||
'fontFamily' => 'font_' . $data['legacy_prefix'],
|
||||
'fontWeight' => $data['legacy_prefix'] . '_font_weight',
|
||||
'textTransform' => $data['legacy_prefix'] . '_font_transform',
|
||||
'fontSize' => $data['legacy_prefix'] . '_font_size',
|
||||
'fontSizeMobile' => 'mobile_' . $data['legacy_prefix'] . 'font_size',
|
||||
'lineHeight' => $data['legacy_prefix'] . '_line_height',
|
||||
);
|
||||
|
||||
if ( 'slideout' === $data['legacy_prefix'] ) {
|
||||
$legacy_setting_ids['fontSizeMobile'] = $data['legacy_prefix'] . '_mobile_font_size';
|
||||
}
|
||||
|
||||
if ( in_array( $data['legacy_prefix'], $no_font_in_ids ) ) {
|
||||
$legacy_setting_ids['fontWeight'] = $data['legacy_prefix'] . '_weight';
|
||||
$legacy_setting_ids['textTransform'] = $data['legacy_prefix'] . '_transform';
|
||||
}
|
||||
|
||||
foreach ( $legacy_setting_ids as $name => $id ) {
|
||||
if ( self::has_saved_value( $id, $settings, $defaults ) ) {
|
||||
$typography_mapping[ $key ][ $name ] = $settings[ $id ];
|
||||
}
|
||||
|
||||
if ( 'secondary_navigation' === $data['legacy_prefix'] && function_exists( 'generate_secondary_nav_get_defaults' ) ) {
|
||||
$secondary_nav_settings = get_option( 'generate_secondary_nav_settings', array() );
|
||||
$secondary_nav_defaults = generate_secondary_nav_get_defaults();
|
||||
|
||||
if ( self::has_saved_value( $id, $secondary_nav_settings, $secondary_nav_defaults ) ) {
|
||||
$typography_mapping[ $key ][ $name ] = $secondary_nav_settings[ $id ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( 'body' === $key ) {
|
||||
if ( self::has_saved_value( 'body_line_height', $settings, $defaults ) ) {
|
||||
$typography_mapping[ $key ]['lineHeightUnit'] = '';
|
||||
}
|
||||
|
||||
if ( self::has_saved_value( 'paragraph_margin', $settings, $defaults ) ) {
|
||||
$typography_mapping[ $key ]['marginBottom'] = $settings['paragraph_margin'];
|
||||
$typography_mapping[ $key ]['marginBottomUnit'] = 'em';
|
||||
}
|
||||
}
|
||||
|
||||
if ( 'widget-titles' === $key && self::has_saved_value( 'widget_title_separator', $settings, $defaults ) ) {
|
||||
$typography_mapping[ $key ]['marginBottom'] = $settings['widget_title_separator'];
|
||||
$typography_mapping[ $key ]['marginBottomUnit'] = 'px';
|
||||
}
|
||||
|
||||
if ( 'h1' === $key || 'h2' === $key || 'h3' === $key ) {
|
||||
if ( self::has_saved_value( $data['legacy_prefix'] . '_margin_bottom', $settings, $defaults ) ) {
|
||||
$typography_mapping[ $key ]['marginBottom'] = $settings[ $data['legacy_prefix'] . '_margin_bottom' ];
|
||||
$typography_mapping[ $key ]['marginBottomUnit'] = 'px';
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $typography_mapping[ $key ]['fontSize'] ) ) {
|
||||
$typography_mapping[ $key ]['fontSizeUnit'] = 'px';
|
||||
}
|
||||
|
||||
if ( isset( $typography_mapping[ $key ] ) ) {
|
||||
$typography_mapping[ $key ]['selector'] = $data['selector'];
|
||||
$typography_mapping[ $key ]['module'] = $data['module'];
|
||||
$typography_mapping[ $key ]['group'] = $data['group'];
|
||||
}
|
||||
}
|
||||
|
||||
// Reset array keys starting at 0.
|
||||
$typography_mapping = array_values( $typography_mapping );
|
||||
|
||||
return $typography_mapping;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all of our mapped font data.
|
||||
*/
|
||||
public static function get_mapped_font_data() {
|
||||
$font_mapping = array();
|
||||
|
||||
foreach ( self::get_option_prefixes() as $key => $data ) {
|
||||
$settings = get_option( 'generate_settings', array() );
|
||||
$defaults = generate_get_default_fonts();
|
||||
|
||||
if ( 'secondary_navigation' === $data['legacy_prefix'] && function_exists( 'generate_secondary_nav_get_defaults' ) ) {
|
||||
$settings = get_option( 'generate_secondary_nav_settings', array() );
|
||||
$defaults = generate_secondary_nav_get_defaults();
|
||||
}
|
||||
|
||||
if ( self::has_saved_value( 'font_' . $data['legacy_prefix'], $settings, $defaults ) ) {
|
||||
$has_font = array_search( $settings[ 'font_' . $data['legacy_prefix'] ], array_column( $font_mapping, 'fontFamily' ) );
|
||||
|
||||
if ( false !== $has_font ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$font_mapping[ $key ]['fontFamily'] = $settings[ 'font_' . $data['legacy_prefix'] ];
|
||||
|
||||
$local_fonts = generate_typography_default_fonts();
|
||||
|
||||
if ( ! in_array( $settings[ 'font_' . $data['legacy_prefix'] ], $local_fonts ) ) {
|
||||
$font_mapping[ $key ]['googleFont'] = true;
|
||||
$font_mapping[ $key ]['googleFontCategory'] = get_theme_mod( 'font_' . $data['legacy_prefix'] . '_category' );
|
||||
$font_mapping[ $key ]['googleFontVariants'] = get_theme_mod( 'font_' . $data['legacy_prefix'] . '_variants' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Reset array keys starting at 0.
|
||||
$font_mapping = array_values( $font_mapping );
|
||||
|
||||
return $font_mapping;
|
||||
}
|
||||
}
|
||||
|
||||
GeneratePress_Typography_Migration::get_instance();
|
@ -1,395 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* This file handles typography on the front-end.
|
||||
*
|
||||
* @package GeneratePress
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles all of our typography option output.
|
||||
*/
|
||||
class GeneratePress_Typography {
|
||||
/**
|
||||
* Class instance.
|
||||
*
|
||||
* @access private
|
||||
* @var $instance Class instance.
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Initiator
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_google_fonts' ) );
|
||||
add_filter( 'generate_editor_styles', array( $this, 'add_editor_styles' ) );
|
||||
add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_editor_scripts' ) );
|
||||
|
||||
// Load fonts the old way in versions before 5.8 as block_editor_settings_all didn't exist.
|
||||
if ( version_compare( $GLOBALS['wp_version'], '5.8', '<' ) ) {
|
||||
add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_google_fonts' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate our Google Fonts URI.
|
||||
*/
|
||||
public static function get_google_fonts_uri() {
|
||||
$fonts = generate_get_option( 'font_manager' );
|
||||
|
||||
if ( empty( $fonts ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$google_fonts_uri = '';
|
||||
$data = array();
|
||||
|
||||
foreach ( $fonts as $font ) {
|
||||
if ( empty( $font['googleFont'] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$variants = array();
|
||||
|
||||
if ( ! empty( $font['googleFontVariants'] ) ) {
|
||||
// Remove spaces from string.
|
||||
$variants = str_replace( ' ', '', $font['googleFontVariants'] );
|
||||
|
||||
// Turn string into array.
|
||||
$variants = explode( ',', $variants );
|
||||
}
|
||||
|
||||
$variants = apply_filters( 'generate_google_font_variants', $variants, $font['fontFamily'] );
|
||||
|
||||
$name = str_replace( ' ', '+', $font['fontFamily'] );
|
||||
$name = str_replace( '"', '', $name );
|
||||
|
||||
if ( $variants ) {
|
||||
$data[] = $name . ':' . implode( ',', $variants );
|
||||
} else {
|
||||
$data[] = $name;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $data ) ) {
|
||||
$font_args = apply_filters(
|
||||
'generate_google_font_args',
|
||||
array(
|
||||
'family' => implode( '|', $data ),
|
||||
'subset' => null,
|
||||
'display' => generate_get_option( 'google_font_display' ),
|
||||
)
|
||||
);
|
||||
|
||||
$google_fonts_uri = add_query_arg( $font_args, 'https://fonts.googleapis.com/css' );
|
||||
}
|
||||
|
||||
return $google_fonts_uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue Google Fonts if they're set.
|
||||
*/
|
||||
public function enqueue_google_fonts() {
|
||||
if ( ! generate_is_using_dynamic_typography() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$google_fonts_uri = self::get_google_fonts_uri();
|
||||
|
||||
if ( $google_fonts_uri ) {
|
||||
wp_enqueue_style( 'generate-google-fonts', $google_fonts_uri, array(), GENERATE_VERSION );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build our typography CSS.
|
||||
*
|
||||
* @param string $module The name of the module we're generating CSS for.
|
||||
* @param string $specific_selector Target a specific selector to get the CSS for.
|
||||
*/
|
||||
public static function get_css( $module = 'core', $specific_selector = '' ) {
|
||||
$typography = generate_get_option( 'typography' );
|
||||
|
||||
// Get data for a specific module so CSS can be compiled separately.
|
||||
$typography = array_filter(
|
||||
(array) $typography,
|
||||
function( $data ) use ( $module ) {
|
||||
return ( isset( $data['module'] ) && $data['module'] === $module );
|
||||
}
|
||||
);
|
||||
|
||||
if ( empty( $typography ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$css = new GeneratePress_CSS();
|
||||
|
||||
$body_selector = 'body';
|
||||
$paragraph_selector = 'p';
|
||||
|
||||
foreach ( $typography as $key => $data ) {
|
||||
$options = wp_parse_args(
|
||||
$data,
|
||||
self::get_defaults()
|
||||
);
|
||||
|
||||
$selector = self::get_css_selector( $options['selector'] );
|
||||
|
||||
if ( 'custom' === $selector ) {
|
||||
$selector = $options['customSelector'];
|
||||
}
|
||||
|
||||
if (
|
||||
$specific_selector &&
|
||||
$options['selector'] !== $specific_selector &&
|
||||
$options['customSelector'] !== $specific_selector
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$font_family = self::get_font_family( $options['fontFamily'] );
|
||||
|
||||
$css->set_selector( $selector );
|
||||
$css->add_property( 'font-family', $font_family );
|
||||
$css->add_property( 'font-weight', $options['fontWeight'] );
|
||||
$css->add_property( 'text-transform', $options['textTransform'] );
|
||||
$css->add_property( 'font-style', $options['fontStyle'] );
|
||||
$css->add_property( 'text-decoration', $options['textDecoration'] );
|
||||
$css->add_property( 'font-size', $options['fontSize'], false, $options['fontSizeUnit'] );
|
||||
$css->add_property( 'letter-spacing', $options['letterSpacing'], false, $options['letterSpacingUnit'] );
|
||||
|
||||
if ( 'body' !== $options['selector'] ) {
|
||||
$css->add_property( 'line-height', $options['lineHeight'], false, $options['lineHeightUnit'] );
|
||||
$css->add_property( 'margin-bottom', $options['marginBottom'], false, $options['marginBottomUnit'] );
|
||||
} else {
|
||||
$css->set_selector( $body_selector );
|
||||
$css->add_property( 'line-height', $options['lineHeight'], false, $options['lineHeightUnit'] );
|
||||
|
||||
$css->set_selector( $paragraph_selector );
|
||||
$css->add_property( 'margin-bottom', $options['marginBottom'], false, $options['marginBottomUnit'] );
|
||||
}
|
||||
|
||||
$css->start_media_query( generate_get_media_query( 'tablet' ) );
|
||||
|
||||
$css->set_selector( $selector );
|
||||
$css->add_property( 'font-size', $options['fontSizeTablet'], false, $options['fontSizeUnit'] );
|
||||
$css->add_property( 'letter-spacing', $options['letterSpacingTablet'], false, $options['letterSpacingUnit'] );
|
||||
|
||||
if ( 'body' !== $options['selector'] ) {
|
||||
$css->add_property( 'line-height', $options['lineHeightTablet'], false, $options['lineHeightUnit'] );
|
||||
$css->add_property( 'margin-bottom', $options['marginBottomTablet'], false, $options['marginBottomUnit'] );
|
||||
} else {
|
||||
$css->set_selector( $body_selector );
|
||||
$css->add_property( 'line-height', $options['lineHeightTablet'], false, $options['lineHeightUnit'] );
|
||||
|
||||
$css->set_selector( $paragraph_selector );
|
||||
$css->add_property( 'margin-bottom', $options['marginBottomTablet'], false, $options['marginBottomUnit'] );
|
||||
}
|
||||
|
||||
$css->stop_media_query();
|
||||
|
||||
$css->start_media_query( generate_get_media_query( 'mobile' ) );
|
||||
|
||||
$css->set_selector( $selector );
|
||||
$css->add_property( 'font-size', $options['fontSizeMobile'], false, $options['fontSizeUnit'] );
|
||||
$css->add_property( 'letter-spacing', $options['letterSpacingMobile'], false, $options['letterSpacingUnit'] );
|
||||
|
||||
if ( 'body' !== $options['selector'] ) {
|
||||
$css->add_property( 'line-height', $options['lineHeightMobile'], false, $options['lineHeightUnit'] );
|
||||
$css->add_property( 'margin-bottom', $options['marginBottomMobile'], false, $options['marginBottomUnit'] );
|
||||
} else {
|
||||
$css->set_selector( $body_selector );
|
||||
$css->add_property( 'line-height', $options['lineHeightMobile'], false, $options['lineHeightUnit'] );
|
||||
|
||||
$css->set_selector( $paragraph_selector );
|
||||
$css->add_property( 'margin-bottom', $options['marginBottomMobile'], false, $options['marginBottomUnit'] );
|
||||
}
|
||||
|
||||
$css->stop_media_query();
|
||||
}
|
||||
|
||||
return $css->css_output();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the CSS selector.
|
||||
*
|
||||
* @param string $selector The saved selector to look up.
|
||||
*/
|
||||
public static function get_css_selector( $selector ) {
|
||||
switch ( $selector ) {
|
||||
case 'body':
|
||||
$selector = 'body, button, input, select, textarea';
|
||||
break;
|
||||
|
||||
case 'main-title':
|
||||
$selector = '.main-title';
|
||||
break;
|
||||
|
||||
case 'site-description':
|
||||
$selector = '.site-description';
|
||||
break;
|
||||
|
||||
case 'primary-menu-items':
|
||||
$selector = '.main-navigation a, .main-navigation .menu-toggle, .main-navigation .menu-bar-items';
|
||||
break;
|
||||
|
||||
case 'primary-sub-menu-items':
|
||||
$selector = '.main-navigation .main-nav ul ul li a';
|
||||
break;
|
||||
|
||||
case 'primary-menu-toggle':
|
||||
$selector = '.main-navigation .menu-toggle';
|
||||
break;
|
||||
|
||||
case 'buttons':
|
||||
$selector = 'button:not(.menu-toggle),html input[type="button"],input[type="reset"],input[type="submit"],.button,.wp-block-button .wp-block-button__link';
|
||||
break;
|
||||
|
||||
case 'all-headings':
|
||||
$selector = 'h1, h2, h3, h4, h5, h6';
|
||||
break;
|
||||
|
||||
case 'single-content-title':
|
||||
$selector = 'h1.entry-title';
|
||||
break;
|
||||
|
||||
case 'archive-content-title':
|
||||
$selector = 'h2.entry-title';
|
||||
break;
|
||||
|
||||
case 'top-bar':
|
||||
$selector = '.top-bar';
|
||||
break;
|
||||
|
||||
case 'widget-titles':
|
||||
$selector = '.widget-title';
|
||||
break;
|
||||
|
||||
case 'footer':
|
||||
$selector = '.site-info';
|
||||
break;
|
||||
}
|
||||
|
||||
return apply_filters( 'generate_typography_css_selector', $selector );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get our full font family value.
|
||||
*
|
||||
* @param string $font_family The font family name.
|
||||
*/
|
||||
public static function get_font_family( $font_family ) {
|
||||
if ( ! $font_family ) {
|
||||
return $font_family;
|
||||
}
|
||||
|
||||
$font_manager = generate_get_option( 'font_manager' );
|
||||
|
||||
$font_families = array();
|
||||
foreach ( (array) $font_manager as $key => $data ) {
|
||||
$font_families[ $data['fontFamily'] ] = $data;
|
||||
}
|
||||
|
||||
$font_family_args = array();
|
||||
if ( ! empty( $font_families[ $font_family ] ) ) {
|
||||
$font_family_args = $font_families[ $font_family ];
|
||||
}
|
||||
|
||||
if ( ! empty( $font_family_args['googleFont'] ) && ! empty( $font_family_args['googleFontCategory'] ) ) {
|
||||
// Add quotations around font names with standalone numbers.
|
||||
if ( preg_match( '/(?<!\S)\d+(?!\S)/', $font_family ) ) {
|
||||
$font_family = '"' . $font_family . '"';
|
||||
}
|
||||
|
||||
$font_family = $font_family . ', ' . $font_family_args['googleFontCategory'];
|
||||
} elseif ( 'System Default' === $font_family ) {
|
||||
$font_family = generate_get_system_default_font();
|
||||
}
|
||||
|
||||
return $font_family;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the defaults for our CSS options.
|
||||
*/
|
||||
public static function get_defaults() {
|
||||
return array(
|
||||
'selector' => '',
|
||||
'customSelector' => '',
|
||||
'fontFamily' => '',
|
||||
'fontWeight' => '',
|
||||
'textTransform' => '',
|
||||
'textDecoration' => '',
|
||||
'fontStyle' => '',
|
||||
'fontSize' => '',
|
||||
'fontSizeTablet' => '',
|
||||
'fontSizeMobile' => '',
|
||||
'fontSizeUnit' => 'px',
|
||||
'lineHeight' => '',
|
||||
'lineHeightTablet' => '',
|
||||
'lineHeightMobile' => '',
|
||||
'lineHeightUnit' => '',
|
||||
'letterSpacing' => '',
|
||||
'letterSpacingTablet' => '',
|
||||
'letterSpacingMobile' => '',
|
||||
'letterSpacingUnit' => 'px',
|
||||
'marginBottom' => '',
|
||||
'marginBottomTablet' => '',
|
||||
'marginBottomMobile' => '',
|
||||
'marginBottomUnit' => 'px',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add editor styles to the block editor.
|
||||
*
|
||||
* @param array $editor_styles Existing styles.
|
||||
*/
|
||||
public function add_editor_styles( $editor_styles ) {
|
||||
if ( generate_is_using_dynamic_typography() ) {
|
||||
$editor_styles[] = 'assets/css/admin/editor-typography.css';
|
||||
}
|
||||
|
||||
return $editor_styles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add scripts to the block editor.
|
||||
*/
|
||||
public function enqueue_editor_scripts() {
|
||||
$html_typography = self::get_css( 'core', 'html' );
|
||||
|
||||
if ( $html_typography ) {
|
||||
wp_add_inline_style(
|
||||
/**
|
||||
* `wp-edit-blocks` is enqueued in the editor, including the iframes.
|
||||
* This is not ideal, as we should use the `block_editor_settings_all` filter to add editor CSS.
|
||||
* However, that filter prepends all selectors with `.editor-styles-wrapper`, which breaks the above
|
||||
* selector, as it appears above that element in the DOM.
|
||||
*
|
||||
* Related: https://github.com/tomusborne/generatepress/issues/472
|
||||
*/
|
||||
'wp-edit-blocks',
|
||||
$html_typography
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GeneratePress_Typography::get_instance();
|