Change theme name from Split to Splits

This commit is contained in:
AlxMedia 2022-12-22 12:54:15 +01:00
parent c7ac424d85
commit 7f892aacf5
36 changed files with 593 additions and 1471 deletions

View file

@ -8,7 +8,7 @@
* or theme author for support.
*
* @package TGM-Plugin-Activation
* @version 2.6.1 for parent theme Split for publication on WordPress.org
* @version 2.6.1 for parent theme Splits for publication on WordPress.org
* @link http://tgmpluginactivation.com/
* @author Thomas Griffin, Gary Jones, Juliette Reinders Folmer
* @copyright Copyright (c) 2011, Thomas Griffin
@ -324,77 +324,77 @@ if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
// Load class strings.
$this->strings = array(
'page_title' => __( 'Install Required Plugins', 'split' ),
'menu_title' => __( 'Install Plugins', 'split' ),
'page_title' => __( 'Install Required Plugins', 'splits' ),
'menu_title' => __( 'Install Plugins', 'splits' ),
/* translators: %s: plugin name. */
'installing' => __( 'Installing Plugin: %s', 'split' ),
'installing' => __( 'Installing Plugin: %s', 'splits' ),
/* translators: %s: plugin name. */
'updating' => __( 'Updating Plugin: %s', 'split' ),
'oops' => __( 'Something went wrong with the plugin API.', 'split' ),
'updating' => __( 'Updating Plugin: %s', 'splits' ),
'oops' => __( 'Something went wrong with the plugin API.', 'splits' ),
'notice_can_install_required' => _n_noop(
/* translators: 1: plugin name(s). */
'This theme requires the following plugin: %1$s.',
'This theme requires the following plugins: %1$s.',
'split'
'splits'
),
'notice_can_install_recommended' => _n_noop(
/* translators: 1: plugin name(s). */
'This theme recommends the following plugin: %1$s.',
'This theme recommends the following plugins: %1$s.',
'split'
'splits'
),
'notice_ask_to_update' => _n_noop(
/* translators: 1: plugin name(s). */
'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.',
'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.',
'split'
'splits'
),
'notice_ask_to_update_maybe' => _n_noop(
/* translators: 1: plugin name(s). */
'There is an update available for: %1$s.',
'There are updates available for the following plugins: %1$s.',
'split'
'splits'
),
'notice_can_activate_required' => _n_noop(
/* translators: 1: plugin name(s). */
'The following required plugin is currently inactive: %1$s.',
'The following required plugins are currently inactive: %1$s.',
'split'
'splits'
),
'notice_can_activate_recommended' => _n_noop(
/* translators: 1: plugin name(s). */
'The following recommended plugin is currently inactive: %1$s.',
'The following recommended plugins are currently inactive: %1$s.',
'split'
'splits'
),
'install_link' => _n_noop(
'Begin installing plugin',
'Begin installing plugins',
'split'
'splits'
),
'update_link' => _n_noop(
'Begin updating plugin',
'Begin updating plugins',
'split'
'splits'
),
'activate_link' => _n_noop(
'Begin activating plugin',
'Begin activating plugins',
'split'
'splits'
),
'return' => __( 'Return to Required Plugins Installer', 'split' ),
'dashboard' => __( 'Return to the Dashboard', 'split' ),
'plugin_activated' => __( 'Plugin activated successfully.', 'split' ),
'activated_successfully' => __( 'The following plugin was activated successfully:', 'split' ),
'return' => __( 'Return to Required Plugins Installer', 'splits' ),
'dashboard' => __( 'Return to the Dashboard', 'splits' ),
'plugin_activated' => __( 'Plugin activated successfully.', 'splits' ),
'activated_successfully' => __( 'The following plugin was activated successfully:', 'splits' ),
/* translators: 1: plugin name. */
'plugin_already_active' => __( 'No action taken. Plugin %1$s was already active.', 'split' ),
'plugin_already_active' => __( 'No action taken. Plugin %1$s was already active.', 'splits' ),
/* translators: 1: plugin name. */
'plugin_needs_higher_version' => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'split' ),
'plugin_needs_higher_version' => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'splits' ),
/* translators: 1: dashboard link. */
'complete' => __( 'All plugins installed and activated successfully. %1$s', 'split' ),
'dismiss' => __( 'Dismiss this notice', 'split' ),
'notice_cannot_install_activate' => __( 'There are one or more required or recommended plugins to install, update or activate.', 'split' ),
'contact_admin' => __( 'Please contact the administrator of this site for help.', 'split' ),
'complete' => __( 'All plugins installed and activated successfully. %1$s', 'splits' ),
'dismiss' => __( 'Dismiss this notice', 'splits' ),
'notice_cannot_install_activate' => __( 'There are one or more required or recommended plugins to install, update or activate.', 'splits' ),
'contact_admin' => __( 'Please contact the administrator of this site for help.', 'splits' ),
);
do_action( 'tgmpa_register' );
@ -519,8 +519,8 @@ if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
$actions['update'] = sprintf(
'<a href="%1$s" title="%2$s" class="edit">%3$s</a>',
esc_url( $this->get_tgmpa_status_url( 'update' ) ),
esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', 'split' ),
esc_html__( 'Update Required', 'split' )
esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', 'splits' ),
esc_html__( 'Update Required', 'splits' )
);
return $actions;
@ -824,7 +824,7 @@ if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
// Display message based on if all plugins are now active or not.
if ( $this->is_tgmpa_complete() ) {
echo '<p>', sprintf( esc_html( $this->strings['complete'] ), '<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'split' ) . '</a>' ), '</p>';
echo '<p>', sprintf( esc_html( $this->strings['complete'] ), '<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'splits' ) . '</a>' ), '</p>';
echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
} else {
echo '<p><a href="', esc_url( $this->get_tgmpa_url() ), '" target="_parent">', esc_html( $this->strings['return'] ), '</a></p>';
@ -931,10 +931,10 @@ if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
if ( true === $GLOBALS['wp_filesystem']->move( $from_path, $to_path ) ) {
return trailingslashit( $to_path );
} else {
return new WP_Error( 'rename_failed', esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'split' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'split' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
return new WP_Error( 'rename_failed', esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'splits' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'splits' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
}
} elseif ( empty( $subdir_name ) ) {
return new WP_Error( 'packaged_wrong', esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.', 'split' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'split' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
return new WP_Error( 'packaged_wrong', esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.', 'splits' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'splits' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
}
}
@ -1118,12 +1118,12 @@ if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
$count = count( $plugin_group );
$linked_plugins = array_map( array( 'TGMPA_Utils', 'wrap_in_em' ), $linked_plugins );
$last_plugin = array_pop( $linked_plugins ); // Pop off last name to prep for readability.
$imploded = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'split' ) . ' ' . $last_plugin );
$imploded = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'splits' ) . ' ' . $last_plugin );
$rendered .= sprintf(
$line_template,
sprintf(
translate_nooped_plural( $this->strings[ $type ], $count, 'split' ),
translate_nooped_plural( $this->strings[ $type ], $count, 'splits' ),
$imploded,
$count
)
@ -1171,14 +1171,14 @@ if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
if ( $install_count > 0 ) {
$action_links['install'] = sprintf(
$link_template,
translate_nooped_plural( $this->strings['install_link'], $install_count, 'split' ),
translate_nooped_plural( $this->strings['install_link'], $install_count, 'splits' ),
esc_url( $this->get_tgmpa_status_url( 'install' ) )
);
}
if ( $update_count > 0 ) {
$action_links['update'] = sprintf(
$link_template,
translate_nooped_plural( $this->strings['update_link'], $update_count, 'split' ),
translate_nooped_plural( $this->strings['update_link'], $update_count, 'splits' ),
esc_url( $this->get_tgmpa_status_url( 'update' ) )
);
}
@ -1187,7 +1187,7 @@ if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
if ( current_user_can( 'activate_plugins' ) && $activate_count > 0 ) {
$action_links['activate'] = sprintf(
$link_template,
translate_nooped_plural( $this->strings['activate_link'], $activate_count, 'split' ),
translate_nooped_plural( $this->strings['activate_link'], $activate_count, 'splits' ),
esc_url( $this->get_tgmpa_status_url( 'activate' ) )
);
}
@ -1979,7 +1979,7 @@ if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
esc_html(
sprintf(
/* translators: %s: version number */
__( 'TGMPA v%s', 'split' ),
__( 'TGMPA v%s', 'splits' ),
self::TGMPA_VERSION
)
),
@ -2270,10 +2270,10 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
*/
protected function get_plugin_advise_type_text( $required ) {
if ( true === $required ) {
return __( 'Required', 'split' );
return __( 'Required', 'splits' );
}
return __( 'Recommended', 'split' );
return __( 'Recommended', 'splits' );
}
/**
@ -2289,13 +2289,13 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
switch ( $type ) {
case 'repo':
$string = __( 'WordPress Repository', 'split' );
$string = __( 'WordPress Repository', 'splits' );
break;
case 'external':
$string = __( 'External Source', 'split' );
$string = __( 'External Source', 'splits' );
break;
case 'bundled':
$string = __( 'Pre-Packaged', 'split' );
$string = __( 'Pre-Packaged', 'splits' );
break;
}
@ -2312,25 +2312,25 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
*/
protected function get_plugin_status_text( $slug ) {
if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) {
return __( 'Not Installed', 'split' );
return __( 'Not Installed', 'splits' );
}
if ( ! $this->tgmpa->is_plugin_active( $slug ) ) {
$install_status = __( 'Installed But Not Activated', 'split' );
$install_status = __( 'Installed But Not Activated', 'splits' );
} else {
$install_status = __( 'Active', 'split' );
$install_status = __( 'Active', 'splits' );
}
$update_status = '';
if ( $this->tgmpa->does_plugin_require_update( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) {
$update_status = __( 'Required Update not Available', 'split' );
$update_status = __( 'Required Update not Available', 'splits' );
} elseif ( $this->tgmpa->does_plugin_require_update( $slug ) ) {
$update_status = __( 'Requires Update', 'split' );
$update_status = __( 'Requires Update', 'splits' );
} elseif ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) {
$update_status = __( 'Update recommended', 'split' );
$update_status = __( 'Update recommended', 'splits' );
}
if ( '' === $update_status ) {
@ -2339,7 +2339,7 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
return sprintf(
/* translators: 1: install status, 2: update status */
_x( '%1$s, %2$s', 'Install/Update Status', 'split' ),
_x( '%1$s, %2$s', 'Install/Update Status', 'splits' ),
$install_status,
$update_status
);
@ -2385,19 +2385,19 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
switch ( $type ) {
case 'all':
/* translators: 1: number of plugins. */
$text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'plugins', 'split' );
$text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'plugins', 'splits' );
break;
case 'install':
/* translators: 1: number of plugins. */
$text = _n( 'To Install <span class="count">(%s)</span>', 'To Install <span class="count">(%s)</span>', $count, 'split' );
$text = _n( 'To Install <span class="count">(%s)</span>', 'To Install <span class="count">(%s)</span>', $count, 'splits' );
break;
case 'update':
/* translators: 1: number of plugins. */
$text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count, 'split' );
$text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count, 'splits' );
break;
case 'activate':
/* translators: 1: number of plugins. */
$text = _n( 'To Activate <span class="count">(%s)</span>', 'To Activate <span class="count">(%s)</span>', $count, 'split' );
$text = _n( 'To Activate <span class="count">(%s)</span>', 'To Activate <span class="count">(%s)</span>', $count, 'splits' );
break;
default:
$text = '';
@ -2479,7 +2479,7 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
$output = array();
if ( $this->tgmpa->is_plugin_installed( $item['slug'] ) ) {
$installed = ! empty( $item['installed_version'] ) ? $item['installed_version'] : _x( 'unknown', 'as in: "version nr unknown"', 'split' );
$installed = ! empty( $item['installed_version'] ) ? $item['installed_version'] : _x( 'unknown', 'as in: "version nr unknown"', 'splits' );
$color = '';
if ( ! empty( $item['minimum_version'] ) && $this->tgmpa->does_plugin_require_update( $item['slug'] ) ) {
@ -2487,7 +2487,7 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
}
$output[] = sprintf(
'<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Installed version:', 'split' ) . '</p>',
'<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Installed version:', 'splits' ) . '</p>',
$color,
$installed
);
@ -2495,7 +2495,7 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
if ( ! empty( $item['minimum_version'] ) ) {
$output[] = sprintf(
'<p><span style="min-width: 32px; text-align: right; float: right;">%1$s</span>' . __( 'Minimum required version:', 'split' ) . '</p>',
'<p><span style="min-width: 32px; text-align: right; float: right;">%1$s</span>' . __( 'Minimum required version:', 'splits' ) . '</p>',
$item['minimum_version']
);
}
@ -2507,7 +2507,7 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
}
$output[] = sprintf(
'<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Available version:', 'split' ) . '</p>',
'<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Available version:', 'splits' ) . '</p>',
$color,
$item['available_version']
);
@ -2530,7 +2530,7 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
* @since 2.2.0
*/
public function no_items() {
echo esc_html__( 'No plugins to install, update or activate.', 'split' ) . ' <a href="' . esc_url( self_admin_url() ) . '"> ' . esc_html__( 'Return to the Dashboard', 'split' ) . '</a>';
echo esc_html__( 'No plugins to install, update or activate.', 'splits' ) . ' <a href="' . esc_url( self_admin_url() ) . '"> ' . esc_html__( 'Return to the Dashboard', 'splits' ) . '</a>';
echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
}
@ -2544,14 +2544,14 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
public function get_columns() {
$columns = array(
'cb' => '<input type="checkbox" />',
'plugin' => __( 'Plugin', 'split' ),
'source' => __( 'Source', 'split' ),
'type' => __( 'Type', 'split' ),
'plugin' => __( 'Plugin', 'splits' ),
'source' => __( 'Source', 'splits' ),
'type' => __( 'Type', 'splits' ),
);
if ( 'all' === $this->view_context || 'update' === $this->view_context ) {
$columns['version'] = __( 'Version', 'split' );
$columns['status'] = __( 'Status', 'split' );
$columns['version'] = __( 'Version', 'splits' );
$columns['status'] = __( 'Status', 'splits' );
}
return apply_filters( 'tgmpa_table_columns', $columns );
@ -2600,18 +2600,18 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
// Display the 'Install' action link if the plugin is not yet available.
if ( ! $this->tgmpa->is_plugin_installed( $item['slug'] ) ) {
/* translators: %2$s: plugin name in screen reader markup */
$actions['install'] = __( 'Install %2$s', 'split' );
$actions['install'] = __( 'Install %2$s', 'splits' );
} else {
// Display the 'Update' action link if an update is available and WP complies with plugin minimum.
if ( false !== $this->tgmpa->does_plugin_have_update( $item['slug'] ) && $this->tgmpa->can_plugin_update( $item['slug'] ) ) {
/* translators: %2$s: plugin name in screen reader markup */
$actions['update'] = __( 'Update %2$s', 'split' );
$actions['update'] = __( 'Update %2$s', 'splits' );
}
// Display the 'Activate' action link, but only if the plugin meets the minimum version.
if ( $this->tgmpa->can_plugin_activate( $item['slug'] ) ) {
/* translators: %2$s: plugin name in screen reader markup */
$actions['activate'] = __( 'Activate %2$s', 'split' );
$actions['activate'] = __( 'Activate %2$s', 'splits' );
}
}
@ -2681,7 +2681,7 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
<tr class="plugin-update-tr">
<td colspan="', absint( $this->get_column_count() ), '" class="plugin-update colspanchange">
<div class="update-message">',
esc_html__( 'Upgrade message from the plugin author:', 'split' ),
esc_html__( 'Upgrade message from the plugin author:', 'splits' ),
' <strong>', wp_kses_data( $item['upgrade_notice'] ), '</strong>
</div>
</td>
@ -2714,16 +2714,16 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
if ( 'update' !== $this->view_context && 'activate' !== $this->view_context ) {
if ( current_user_can( 'install_plugins' ) ) {
$actions['tgmpa-bulk-install'] = __( 'Install', 'split' );
$actions['tgmpa-bulk-install'] = __( 'Install', 'splits' );
}
}
if ( 'install' !== $this->view_context ) {
if ( current_user_can( 'update_plugins' ) ) {
$actions['tgmpa-bulk-update'] = __( 'Update', 'split' );
$actions['tgmpa-bulk-update'] = __( 'Update', 'splits' );
}
if ( current_user_can( 'activate_plugins' ) ) {
$actions['tgmpa-bulk-activate'] = __( 'Activate', 'split' );
$actions['tgmpa-bulk-activate'] = __( 'Activate', 'splits' );
}
}
@ -2754,9 +2754,9 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
// Did user actually select any plugins to install/update ?
if ( empty( $_POST['plugin'] ) ) {
if ( 'install' === $install_type ) {
$message = __( 'No plugins were selected to be installed. No action taken.', 'split' );
$message = __( 'No plugins were selected to be installed. No action taken.', 'splits' );
} else {
$message = __( 'No plugins were selected to be updated. No action taken.', 'split' );
$message = __( 'No plugins were selected to be updated. No action taken.', 'splits' );
}
echo '<div id="message" class="error"><p>', esc_html( $message ), '</p></div>';
@ -2797,9 +2797,9 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
// No need to proceed further if we have no plugins to handle.
if ( empty( $plugins_to_install ) ) {
if ( 'install' === $install_type ) {
$message = __( 'No plugins are available to be installed at this time.', 'split' );
$message = __( 'No plugins are available to be installed at this time.', 'splits' );
} else {
$message = __( 'No plugins are available to be updated at this time.', 'split' );
$message = __( 'No plugins are available to be updated at this time.', 'splits' );
}
echo '<div id="message" class="error"><p>', esc_html( $message ), '</p></div>';
@ -2905,7 +2905,7 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
// Did user actually select any plugins to activate ?
if ( empty( $_POST['plugin'] ) ) {
echo '<div id="message" class="error"><p>', esc_html__( 'No plugins were selected to be activated. No action taken.', 'split' ), '</p></div>';
echo '<div id="message" class="error"><p>', esc_html__( 'No plugins were selected to be activated. No action taken.', 'splits' ), '</p></div>';
return false;
}
@ -2931,7 +2931,7 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
// Return early if there are no plugins to activate.
if ( empty( $plugins_to_activate ) ) {
echo '<div id="message" class="error"><p>', esc_html__( 'No plugins are available to be activated at this time.', 'split' ), '</p></div>';
echo '<div id="message" class="error"><p>', esc_html__( 'No plugins are available to be activated at this time.', 'splits' ), '</p></div>';
return false;
}
@ -2945,11 +2945,11 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
$count = count( $plugin_names ); // Count so we can use _n function.
$plugin_names = array_map( array( 'TGMPA_Utils', 'wrap_in_strong' ), $plugin_names );
$last_plugin = array_pop( $plugin_names ); // Pop off last name to prep for readability.
$imploded = empty( $plugin_names ) ? $last_plugin : ( implode( ', ', $plugin_names ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'split' ) . ' ' . $last_plugin );
$imploded = empty( $plugin_names ) ? $last_plugin : ( implode( ', ', $plugin_names ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'splits' ) . ' ' . $last_plugin );
printf( // WPCS: xss ok.
'<div id="message" class="updated"><p>%1$s %2$s.</p></div>',
esc_html( _n( 'The following plugin was activated successfully:', 'The following plugins were activated successfully:', $count, 'split' ) ),
esc_html( _n( 'The following plugin was activated successfully:', 'The following plugins were activated successfully:', $count, 'splits' ) ),
$imploded
);
@ -3155,8 +3155,8 @@ if ( ! function_exists( 'tgmpa_load_bulk_installer' ) ) {
* @since 2.2.0
*/
public function activate_strings() {
$this->strings['activation_failed'] = __( 'Plugin activation failed.', 'split' );
$this->strings['activation_success'] = __( 'Plugin activated successfully.', 'split' );
$this->strings['activation_failed'] = __( 'Plugin activation failed.', 'splits' );
$this->strings['activation_success'] = __( 'Plugin activated successfully.', 'splits' );
}
/**
@ -3495,29 +3495,29 @@ if ( ! function_exists( 'tgmpa_load_bulk_installer' ) ) {
if ( 'update' === $this->options['install_type'] ) {
parent::add_strings();
/* translators: 1: plugin name, 2: action number 3: total number of actions. */
$this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'split' );
$this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'splits' );
} else {
/* translators: 1: plugin name, 2: error message. */
$this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: <strong>%2$s</strong>.', 'split' );
$this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: <strong>%2$s</strong>.', 'splits' );
/* translators: 1: plugin name. */
$this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'split' );
$this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'splits' );
if ( $this->tgmpa->is_automatic ) {
// Automatic activation strings.
$this->upgrader->strings['skin_upgrade_start'] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'split' );
$this->upgrader->strings['skin_upgrade_start'] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'splits' );
/* translators: 1: plugin name. */
$this->upgrader->strings['skin_update_successful'] = __( '%1$s installed and activated successfully.', 'split' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'split' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'split' ) . '</span>.</a>';
$this->upgrader->strings['skin_upgrade_end'] = __( 'All installations and activations have been completed.', 'split' );
$this->upgrader->strings['skin_update_successful'] = __( '%1$s installed and activated successfully.', 'splits' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'splits' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'splits' ) . '</span>.</a>';
$this->upgrader->strings['skin_upgrade_end'] = __( 'All installations and activations have been completed.', 'splits' );
/* translators: 1: plugin name, 2: action number 3: total number of actions. */
$this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'split' );
$this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'splits' );
} else {
// Default installation strings.
$this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'split' );
$this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'splits' );
/* translators: 1: plugin name. */
$this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', 'split' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'split' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'split' ) . '</span>.</a>';
$this->upgrader->strings['skin_upgrade_end'] = __( 'All installations have been completed.', 'split' );
$this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', 'splits' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'splits' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'splits' ) . '</span>.</a>';
$this->upgrader->strings['skin_upgrade_end'] = __( 'All installations have been completed.', 'splits' );
/* translators: 1: plugin name, 2: action number 3: total number of actions. */
$this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'split' );
$this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'splits' );
}
}
}
@ -3577,7 +3577,7 @@ if ( ! function_exists( 'tgmpa_load_bulk_installer' ) ) {
echo '<style type="text/css">#adminmenu .wp-submenu li.current { display: none !important; }</style>';
$update_actions['dashboard'] = sprintf(
esc_html( $this->tgmpa->strings['complete'] ),
'<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'split' ) . '</a>'
'<a href="' . esc_url( self_admin_url() ) . '">' . esc_html__( 'Return to the Dashboard', 'splits' ) . '</a>'
);
} else {
$update_actions['tgmpa_page'] = '<a href="' . esc_url( $this->tgmpa->get_tgmpa_url() ) . '" target="_parent">' . esc_html( $this->tgmpa->strings['return'] ) . '</a>';

View file

@ -5,9 +5,9 @@
/* Convert hexadecimal to rgb
/* ------------------------------------ */
if ( ! function_exists( 'split_hex2rgb' ) ) {
if ( ! function_exists( 'splits_hex2rgb' ) ) {
function split_hex2rgb( $hex, $array=false ) {
function splits_hex2rgb( $hex, $array=false ) {
$hex = str_replace("#", "", $hex);
if ( strlen($hex) == 3 ) {
@ -30,9 +30,9 @@ if ( ! function_exists( 'split_hex2rgb' ) ) {
/* Google fonts
/* ------------------------------------ */
if ( ! function_exists( 'split_enqueue_google_fonts' ) ) {
if ( ! function_exists( 'splits_enqueue_google_fonts' ) ) {
function split_enqueue_google_fonts () {
function splits_enqueue_google_fonts () {
if ( get_theme_mod('dynamic-styles', 'on') == 'on' ) {
if ( get_theme_mod( 'font' ) == 'titillium-web-ext' ) { wp_enqueue_style( 'titillium-web-ext', '//fonts.googleapis.com/css?family=Titillium+Web:400,400italic,300italic,300,600&subset=latin,latin-ext' ); }
if ( get_theme_mod( 'font' ) == 'droid-serif' ) { wp_enqueue_style( 'droid-serif', '//fonts.googleapis.com/css?family=Droid+Serif:400,400italic,700' ); }
@ -57,19 +57,19 @@ if ( ! function_exists( 'split_enqueue_google_fonts' ) ) {
}
}
add_action( 'wp_enqueue_scripts', 'split_enqueue_google_fonts' );
add_action( 'wp_enqueue_scripts', 'splits_enqueue_google_fonts' );
/* Dynamic css output
/* ------------------------------------ */
if ( ! function_exists( 'split_dynamic_css' ) ) {
if ( ! function_exists( 'splits_dynamic_css' ) ) {
function split_dynamic_css() {
function splits_dynamic_css() {
if ( get_theme_mod('dynamic-styles', 'on') == 'on' ) {
// rgb values
$color_1 = get_theme_mod('color-1');
$color_1_rgb = split_hex2rgb($color_1);
$color_1_rgb = splits_hex2rgb($color_1);
// start output
$styles = '';
@ -204,9 +204,9 @@ a,
if ( get_theme_mod( 'header_textcolor' ) != '' ) {
$styles .= '.site-title a, .site-description { color: #'.esc_attr( get_theme_mod( 'header_textcolor' ) ).'; }'."\n";
}
wp_add_inline_style( 'split-style', $styles );
wp_add_inline_style( 'splits-style', $styles );
}
}
}
add_action( 'wp_enqueue_scripts', 'split_dynamic_css' );
add_action( 'wp_enqueue_scripts', 'splits_dynamic_css' );

View file

@ -1,5 +1,5 @@
<?php
function split_get_meta_box( $meta_boxes ) {
function splits_get_meta_box( $meta_boxes ) {
/* do not show */
$prefix = '_';
@ -18,7 +18,7 @@ function split_get_meta_box( $meta_boxes ) {
/* ------------------------------------ */
$meta_boxes[] = array(
'id' => 'page-options',
'title' => esc_html__( 'Page Options', 'split' ),
'title' => esc_html__( 'Page Options', 'splits' ),
'post_types' => array( 'page' ),
'context' => 'advanced',
'priority' => 'high',
@ -26,15 +26,15 @@ function split_get_meta_box( $meta_boxes ) {
'fields' => array(
array(
'id' => $prefix . 'sidebar_primary',
'name' => esc_html__( 'Primary Sidebar', 'split' ),
'name' => esc_html__( 'Primary Sidebar', 'splits' ),
'type' => 'select',
'placeholder' => esc_html__( 'Select a sidebar', 'split' ),
'placeholder' => esc_html__( 'Select a sidebar', 'splits' ),
'options' => $sidebars_choices,
),
array(
'id' => $prefix . 'layout',
'type' => 'image_select',
'name' => esc_html__( 'Layout', 'split' ),
'name' => esc_html__( 'Layout', 'splits' ),
'std' => 'inherit',
'force_delete' => false,
'max_file_uploads' => '4',
@ -51,7 +51,7 @@ function split_get_meta_box( $meta_boxes ) {
/* ------------------------------------ */
$meta_boxes[] = array(
'id' => 'post-options',
'title' => esc_html__( 'Post Options', 'split' ),
'title' => esc_html__( 'Post Options', 'splits' ),
'post_types' => array( 'post' ),
'context' => 'advanced',
'priority' => 'high',
@ -59,15 +59,15 @@ function split_get_meta_box( $meta_boxes ) {
'fields' => array(
array(
'id' => $prefix . 'sidebar_primary',
'name' => esc_html__( 'Primary Sidebar', 'split' ),
'name' => esc_html__( 'Primary Sidebar', 'splits' ),
'type' => 'select',
'placeholder' => esc_html__( 'Select a sidebar', 'split' ),
'placeholder' => esc_html__( 'Select a sidebar', 'splits' ),
'options' => $sidebars_choices,
),
array(
'id' => $prefix . 'layout',
'type' => 'image_select',
'name' => esc_html__( 'Layout', 'split' ),
'name' => esc_html__( 'Layout', 'splits' ),
'std' => 'inherit',
'force_delete' => false,
'max_file_uploads' => '4',
@ -82,4 +82,4 @@ function split_get_meta_box( $meta_boxes ) {
return $meta_boxes;
}
add_filter( 'rwmb_meta_boxes', 'split_get_meta_box' );
add_filter( 'rwmb_meta_boxes', 'splits_get_meta_box' );

View file

@ -167,7 +167,7 @@ class Nav {
*/
public static function nav_menu( $args, $toggle_label = false, $nav_classes = 'main-navigation nav-menu' ) {
if ( false === $toggle_label ) {
$toggle_label = '<span class="screen-reader-text">' . esc_html__( 'Expand Menu', 'split' ) . '</span><div class="menu-toggle-icon"><span></span><span></span><span></span></div>';
$toggle_label = '<span class="screen-reader-text">' . esc_html__( 'Expand Menu', 'splits' ) . '</span><div class="menu-toggle-icon"><span></span><span></span><span></span></div>';
}
?>
<nav id="<?php echo esc_attr( $args['menu_id'] ); ?>-nav" class="<?php echo esc_attr( $nav_classes ); ?>">
@ -209,7 +209,7 @@ class Nav {
// Skip when the item has no sub-menu.
if ( in_array( 'menu-item-has-children', $item->classes, true ) ) {
$html = '<span class="menu-item-wrapper has-arrow">';
$item_output .= '<button onClick="alxMediaMenu.toggleItem(this)"><span class="screen-reader-text">' . esc_html__( 'Toggle Child Menu', 'split' ) . '</span><svg class="svg-icon" aria-hidden="true" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" width="14" height="8" viewBox="0 0 20 12"><polygon fill="" fill-rule="evenodd" points="1319.899 365.778 1327.678 358 1329.799 360.121 1319.899 370.021 1310 360.121 1312.121 358" transform="translate(-1310 -358)"></polygon></svg></button>';
$item_output .= '<button onClick="alxMediaMenu.toggleItem(this)"><span class="screen-reader-text">' . esc_html__( 'Toggle Child Menu', 'splits' ) . '</span><svg class="svg-icon" aria-hidden="true" role="img" focusable="false" xmlns="http://www.w3.org/2000/svg" width="14" height="8" viewBox="0 0 20 12"><polygon fill="" fill-rule="evenodd" points="1319.899 365.778 1327.678 358 1329.799 360.121 1319.899 370.021 1310 360.121 1312.121 358" transform="translate(-1310 -358)"></polygon></svg></button>';
}
$html .= $item_output;
@ -283,8 +283,8 @@ class Nav {
*/
return sprintf(
/* Translators: %1$s: "Current Page:". %2$s: The menu-item title. */
__( '<span class="screen-reader-text">%1$s </span>%2$s', 'split' ),
esc_html__( 'Current Page:', 'split' ),
__( '<span class="screen-reader-text">%1$s </span>%2$s', 'splits' ),
esc_html__( 'Current Page:', 'splits' ),
$title
);
}
@ -297,8 +297,8 @@ class Nav {
*/
return sprintf(
/* Translators: %1$s: "Current Page Parent:". %2$s: The menu-item title. */
__( '<span class="screen-reader-text">%1$s </span>%2$s', 'split' ),
esc_html__( 'Current Page Parent', 'split' ),
__( '<span class="screen-reader-text">%1$s </span>%2$s', 'splits' ),
esc_html__( 'Current Page Parent', 'splits' ),
$title
);
}

View file

@ -5,7 +5,7 @@ if ( ! class_exists( 'Kirki' ) ) {
/* Add Config
/* ------------------------------------ */
Kirki::add_config( 'split', array(
Kirki::add_config( 'splits', array(
'capability' => 'edit_theme_options',
'option_type' => 'theme_mod',
) );
@ -14,49 +14,49 @@ Kirki::add_config( 'split', array(
/* ------------------------------------ */
Kirki::add_panel( 'options', array(
'priority' => 10,
'title' => esc_html__( 'Theme Options', 'split' ),
'title' => esc_html__( 'Theme Options', 'splits' ),
) );
/* Add Sections
/* ------------------------------------ */
Kirki::add_section( 'general', array(
'priority' => 10,
'title' => esc_html__( 'General', 'split' ),
'title' => esc_html__( 'General', 'splits' ),
'panel' => 'options',
) );
Kirki::add_section( 'blog', array(
'priority' => 20,
'title' => esc_html__( 'Blog', 'split' ),
'title' => esc_html__( 'Blog', 'splits' ),
'panel' => 'options',
) );
Kirki::add_section( 'header', array(
'priority' => 30,
'title' => esc_html__( 'Header', 'split' ),
'title' => esc_html__( 'Header', 'splits' ),
'panel' => 'options',
) );
Kirki::add_section( 'footer', array(
'priority' => 40,
'title' => esc_html__( 'Footer', 'split' ),
'title' => esc_html__( 'Footer', 'splits' ),
'panel' => 'options',
) );
Kirki::add_section( 'layout', array(
'priority' => 50,
'title' => esc_html__( 'Layout', 'split' ),
'title' => esc_html__( 'Layout', 'splits' ),
'panel' => 'options',
) );
Kirki::add_section( 'sidebars', array(
'priority' => 60,
'title' => esc_html__( 'Sidebars', 'split' ),
'title' => esc_html__( 'Sidebars', 'splits' ),
'panel' => 'options',
) );
Kirki::add_section( 'social', array(
'priority' => 70,
'title' => esc_html__( 'Social Links', 'split' ),
'title' => esc_html__( 'Social Links', 'splits' ),
'panel' => 'options',
) );
Kirki::add_section( 'styling', array(
'priority' => 80,
'title' => esc_html__( 'Styling', 'split' ),
'title' => esc_html__( 'Styling', 'splits' ),
'panel' => 'options',
) );
@ -64,78 +64,78 @@ Kirki::add_section( 'styling', array(
/* ------------------------------------ */
// General: Mobile Sidebar
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'switch',
'settings' => 'mobile-sidebar-hide',
'label' => esc_html__( 'Mobile Sidebar Content', 'split' ),
'description' => esc_html__( 'Sidebar content on low-resolution mobile devices (320px)', 'split' ),
'label' => esc_html__( 'Mobile Sidebar Content', 'splits' ),
'description' => esc_html__( 'Sidebar content on low-resolution mobile devices (320px)', 'splits' ),
'section' => 'general',
'default' => 'on',
) );
// General: Post Comments
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'switch',
'settings' => 'post-comments',
'label' => esc_html__( 'Post Comments', 'split' ),
'description' => esc_html__( 'Comments on posts', 'split' ),
'label' => esc_html__( 'Post Comments', 'splits' ),
'description' => esc_html__( 'Comments on posts', 'splits' ),
'section' => 'general',
'default' => 'on',
) );
// General: Page Comments
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'switch',
'settings' => 'page-comments',
'label' => esc_html__( 'Page Comments', 'split' ),
'description' => esc_html__( 'Comments on pages', 'split' ),
'label' => esc_html__( 'Page Comments', 'splits' ),
'description' => esc_html__( 'Comments on pages', 'splits' ),
'section' => 'general',
'default' => 'off',
) );
// General: Recommended Plugins
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'switch',
'settings' => 'recommended-plugins',
'label' => esc_html__( 'Recommended Plugins', 'split' ),
'description' => esc_html__( 'Enable or disable the recommended plugins notice', 'split' ),
'label' => esc_html__( 'Recommended Plugins', 'splits' ),
'description' => esc_html__( 'Enable or disable the recommended plugins notice', 'splits' ),
'section' => 'general',
'default' => 'on',
) );
// Blog: Blog Layout
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'radio',
'settings' => 'blog-layout',
'label' => esc_html__( 'Blog Layout', 'split' ),
'label' => esc_html__( 'Blog Layout', 'splits' ),
'section' => 'blog',
'default' => 'blog-list',
'choices' => array(
'blog-standard' => esc_html__( 'Standard', 'split' ),
'blog-grid' => esc_html__( 'Grid', 'split' ),
'blog-list' => esc_html__( 'List', 'split' ),
'blog-standard' => esc_html__( 'Standard', 'splits' ),
'blog-grid' => esc_html__( 'Grid', 'splits' ),
'blog-list' => esc_html__( 'List', 'splits' ),
),
) );
// Blog: Heading
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'text',
'settings' => 'blog-heading',
'label' => esc_html__( 'Heading', 'split' ),
'description' => esc_html__( 'Your blog heading', 'split' ),
'label' => esc_html__( 'Heading', 'splits' ),
'description' => esc_html__( 'Your blog heading', 'splits' ),
'section' => 'blog',
'default' => '',
) );
// Blog: Subheading
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'text',
'settings' => 'blog-subheading',
'label' => esc_html__( 'Subheading', 'split' ),
'description' => esc_html__( 'Your blog subheading', 'split' ),
'label' => esc_html__( 'Subheading', 'splits' ),
'description' => esc_html__( 'Your blog subheading', 'splits' ),
'section' => 'blog',
'default' => '',
) );
// Blog: Excerpt Length
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'slider',
'settings' => 'excerpt-length',
'label' => esc_html__( 'Excerpt Length', 'split' ),
'description' => esc_html__( 'Max number of words. Set it to 0 to disable.', 'split' ),
'label' => esc_html__( 'Excerpt Length', 'splits' ),
'description' => esc_html__( 'Max number of words. Set it to 0 to disable.', 'splits' ),
'section' => 'blog',
'default' => '24',
'choices' => array(
@ -145,22 +145,22 @@ Kirki::add_field( 'split_theme', array(
),
) );
// Blog: Featured Category
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'select',
'settings' => 'featured-category',
'label' => esc_html__( 'Featured Category', 'split' ),
'description' => esc_html__( 'By not selecting a category, it will show your latest post(s) from all categories', 'split' ),
'label' => esc_html__( 'Featured Category', 'splits' ),
'description' => esc_html__( 'By not selecting a category, it will show your latest post(s) from all categories', 'splits' ),
'section' => 'blog',
'default' => '',
'choices' => Kirki_Helper::get_terms( 'category' ),
'placeholder' => esc_html__( 'Select a category', 'split' ),
'placeholder' => esc_html__( 'Select a category', 'splits' ),
) );
// Blog: Featured Post Count
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'slider',
'settings' => 'featured-posts-count',
'label' => esc_html__( 'Featured Post Count', 'split' ),
'description' => esc_html__( 'Max number of featured posts to display on the homepage.', 'split' ),
'label' => esc_html__( 'Featured Post Count', 'splits' ),
'description' => esc_html__( 'Max number of featured posts to display on the homepage.', 'splits' ),
'section' => 'blog',
'default' => '3',
'choices' => array(
@ -170,31 +170,31 @@ Kirki::add_field( 'split_theme', array(
),
) );
// Blog: Featured Posts Include
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'checkbox',
'settings' => 'featured-posts-include',
'label' => esc_html__( 'Featured Posts', 'split' ),
'description' => esc_html__( 'To show featured posts in the slider AND the content below. Usually not recommended.', 'split' ),
'label' => esc_html__( 'Featured Posts', 'splits' ),
'description' => esc_html__( 'To show featured posts in the slider AND the content below. Usually not recommended.', 'splits' ),
'section' => 'blog',
'default' => false,
) );
// Blog: Highlight Category
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'select',
'settings' => 'highlight-category',
'label' => esc_html__( 'Highlight Category', 'split' ),
'description' => esc_html__( 'By not selecting a category, it will show your latest post(s) from all categories', 'split' ),
'label' => esc_html__( 'Highlight Category', 'splits' ),
'description' => esc_html__( 'By not selecting a category, it will show your latest post(s) from all categories', 'splits' ),
'section' => 'blog',
'default' => '',
'choices' => Kirki_Helper::get_terms( 'category' ),
'placeholder' => esc_html__( 'Select a category', 'split' ),
'placeholder' => esc_html__( 'Select a category', 'splits' ),
) );
// Blog: Highlights Category Count
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'slider',
'settings' => 'highlight-posts-count',
'label' => esc_html__( 'Highlight Post Count', 'split' ),
'description' => esc_html__( 'Max number of highlight posts to display. Set it to 0 to disable.', 'split' ),
'label' => esc_html__( 'Highlight Post Count', 'splits' ),
'description' => esc_html__( 'Max number of highlight posts to display. Set it to 0 to disable.', 'splits' ),
'section' => 'blog',
'default' => '7',
'choices' => array(
@ -204,111 +204,111 @@ Kirki::add_field( 'split_theme', array(
),
) );
// Blog: Frontpage Widgets Top
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'switch',
'settings' => 'frontpage-widgets-top',
'label' => esc_html__( 'Frontpage Widgets Top', 'split' ),
'description' => esc_html__( '2 columns of widgets', 'split' ),
'label' => esc_html__( 'Frontpage Widgets Top', 'splits' ),
'description' => esc_html__( '2 columns of widgets', 'splits' ),
'section' => 'blog',
'default' => 'off',
) );
// Blog: Frontpage Widgets Bottom
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'switch',
'settings' => 'frontpage-widgets-bottom',
'label' => esc_html__( 'Frontpage Widgets Bottom', 'split' ),
'description' => esc_html__( '2 columns of widgets', 'split' ),
'label' => esc_html__( 'Frontpage Widgets Bottom', 'splits' ),
'description' => esc_html__( '2 columns of widgets', 'splits' ),
'section' => 'blog',
'default' => 'off',
) );
// Blog: Comment Count
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'switch',
'settings' => 'comment-count',
'label' => esc_html__( 'Thumbnail Comment Count', 'split' ),
'description' => esc_html__( 'Comment count on thumbnails', 'split' ),
'label' => esc_html__( 'Thumbnail Comment Count', 'splits' ),
'description' => esc_html__( 'Comment count on thumbnails', 'splits' ),
'section' => 'blog',
'default' => 'on',
) );
// Blog: Single - Authorbox
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'switch',
'settings' => 'author-bio',
'label' => esc_html__( 'Single - Author Bio', 'split' ),
'description' => esc_html__( 'Shows post author description, if it exists', 'split' ),
'label' => esc_html__( 'Single - Author Bio', 'splits' ),
'description' => esc_html__( 'Shows post author description, if it exists', 'splits' ),
'section' => 'blog',
'default' => 'on',
) );
// Blog: Single - Related Posts
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'radio',
'settings' => 'related-posts',
'label' => esc_html__( 'Single - Related Posts', 'split' ),
'description' => esc_html__( 'Shows randomized related articles below the post', 'split' ),
'label' => esc_html__( 'Single - Related Posts', 'splits' ),
'description' => esc_html__( 'Shows randomized related articles below the post', 'splits' ),
'section' => 'blog',
'default' => 'categories',
'choices' => array(
'disable' => esc_html__( 'Disable', 'split' ),
'categories'=> esc_html__( 'Related by categories', 'split' ),
'tags' => esc_html__( 'Related by tags', 'split' ),
'disable' => esc_html__( 'Disable', 'splits' ),
'categories'=> esc_html__( 'Related by categories', 'splits' ),
'tags' => esc_html__( 'Related by tags', 'splits' ),
),
) );
// Blog: Single - Post Navigation
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'radio',
'settings' => 'post-nav',
'label' => esc_html__( 'Single - Post Navigation', 'split' ),
'description' => esc_html__( 'Shows links to the next and previous article', 'split' ),
'label' => esc_html__( 'Single - Post Navigation', 'splits' ),
'description' => esc_html__( 'Shows links to the next and previous article', 'splits' ),
'section' => 'blog',
'default' => 's1',
'choices' => array(
'disable' => esc_html__( 'Disable', 'split' ),
's1' => esc_html__( 'Sidebar Primary', 'split' ),
'content' => esc_html__( 'Below content', 'split' ),
'disable' => esc_html__( 'Disable', 'splits' ),
's1' => esc_html__( 'Sidebar Primary', 'splits' ),
'content' => esc_html__( 'Below content', 'splits' ),
),
) );
// Header: Ads
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'switch',
'settings' => 'header-ads',
'label' => esc_html__( 'Header Ads', 'split' ),
'description' => esc_html__( 'Header widget ads area', 'split' ),
'label' => esc_html__( 'Header Ads', 'splits' ),
'description' => esc_html__( 'Header widget ads area', 'splits' ),
'section' => 'header',
'default' => 'off',
) );
// Header: Search
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'switch',
'settings' => 'header-search',
'label' => esc_html__( 'Header Search', 'split' ),
'description' => esc_html__( 'Header search button', 'split' ),
'label' => esc_html__( 'Header Search', 'splits' ),
'description' => esc_html__( 'Header search button', 'splits' ),
'section' => 'header',
'default' => 'on',
) );
// Header: Social Links
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'switch',
'settings' => 'header-social',
'label' => esc_html__( 'Header Social Links', 'split' ),
'description' => esc_html__( 'Social link icon buttons', 'split' ),
'label' => esc_html__( 'Header Social Links', 'splits' ),
'description' => esc_html__( 'Social link icon buttons', 'splits' ),
'section' => 'header',
'default' => 'on',
) );
// Footer: Ads
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'switch',
'settings' => 'footer-ads',
'label' => esc_html__( 'Footer Ads', 'split' ),
'description' => esc_html__( 'Footer widget ads area', 'split' ),
'label' => esc_html__( 'Footer Ads', 'splits' ),
'description' => esc_html__( 'Footer widget ads area', 'splits' ),
'section' => 'footer',
'default' => 'off',
) );
// Footer: Widget Columns
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'radio-image',
'settings' => 'footer-widgets',
'label' => esc_html__( 'Footer Widget Columns', 'split' ),
'description' => esc_html__( 'Select columns to enable footer widgets. Recommended number: 3', 'split' ),
'label' => esc_html__( 'Footer Widget Columns', 'splits' ),
'description' => esc_html__( 'Select columns to enable footer widgets. Recommended number: 3', 'splits' ),
'section' => 'footer',
'default' => '0',
'choices' => array(
@ -320,47 +320,47 @@ Kirki::add_field( 'split_theme', array(
),
) );
// Footer: Social Links
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'switch',
'settings' => 'footer-social',
'label' => esc_html__( 'Footer Social Links', 'split' ),
'description' => esc_html__( 'Social link icon buttons', 'split' ),
'label' => esc_html__( 'Footer Social Links', 'splits' ),
'description' => esc_html__( 'Social link icon buttons', 'splits' ),
'section' => 'footer',
'default' => 'on',
) );
// Footer: Custom Logo
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'image',
'settings' => 'footer-logo',
'label' => esc_html__( 'Footer Logo', 'split' ),
'description' => esc_html__( 'Upload your custom logo image', 'split' ),
'label' => esc_html__( 'Footer Logo', 'splits' ),
'description' => esc_html__( 'Upload your custom logo image', 'splits' ),
'section' => 'footer',
'default' => '',
) );
// Footer: Copyright
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'text',
'settings' => 'copyright',
'label' => esc_html__( 'Footer Copyright', 'split' ),
'description' => esc_html__( 'Replace the footer copyright text', 'split' ),
'label' => esc_html__( 'Footer Copyright', 'splits' ),
'description' => esc_html__( 'Replace the footer copyright text', 'splits' ),
'section' => 'footer',
'default' => '',
) );
// Footer: Credit
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'switch',
'settings' => 'credit',
'label' => esc_html__( 'Footer Credit', 'split' ),
'description' => esc_html__( 'Footer credit text', 'split' ),
'label' => esc_html__( 'Footer Credit', 'splits' ),
'description' => esc_html__( 'Footer credit text', 'splits' ),
'section' => 'footer',
'default' => 'on',
) );
// Layout: Global
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'radio-image',
'settings' => 'layout-global',
'label' => esc_html__( 'Global Layout', 'split' ),
'description' => esc_html__( 'Other layouts will override this option if they are set', 'split' ),
'label' => esc_html__( 'Global Layout', 'splits' ),
'description' => esc_html__( 'Other layouts will override this option if they are set', 'splits' ),
'section' => 'layout',
'default' => 'col-2cl',
'choices' => array(
@ -369,11 +369,11 @@ Kirki::add_field( 'split_theme', array(
),
) );
// Layout: Home
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'radio-image',
'settings' => 'layout-home',
'label' => esc_html__( 'Home', 'split' ),
'description' => esc_html__( '(is_home) Posts homepage layout', 'split' ),
'label' => esc_html__( 'Home', 'splits' ),
'description' => esc_html__( '(is_home) Posts homepage layout', 'splits' ),
'section' => 'layout',
'default' => 'inherit',
'choices' => array(
@ -383,11 +383,11 @@ Kirki::add_field( 'split_theme', array(
),
) );
// Layout: Single
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'radio-image',
'settings' => 'layout-single',
'label' => esc_html__( 'Single', 'split' ),
'description' => esc_html__( '(is_single) Single post layout - If a post has a set layout, it will override this.', 'split' ),
'label' => esc_html__( 'Single', 'splits' ),
'description' => esc_html__( '(is_single) Single post layout - If a post has a set layout, it will override this.', 'splits' ),
'section' => 'layout',
'default' => 'inherit',
'choices' => array(
@ -397,11 +397,11 @@ Kirki::add_field( 'split_theme', array(
),
) );
// Layout: Archive
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'radio-image',
'settings' => 'layout-archive',
'label' => esc_html__( 'Archive', 'split' ),
'description' => esc_html__( '(is_archive) Category, date, tag and author archive layout', 'split' ),
'label' => esc_html__( 'Archive', 'splits' ),
'description' => esc_html__( '(is_archive) Category, date, tag and author archive layout', 'splits' ),
'section' => 'layout',
'default' => 'inherit',
'choices' => array(
@ -411,11 +411,11 @@ Kirki::add_field( 'split_theme', array(
),
) );
// Layout : Archive - Category
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'radio-image',
'settings' => 'layout-archive-category',
'label' => esc_html__( 'Archive - Category', 'split' ),
'description' => esc_html__( '(is_category) Category archive layout', 'split' ),
'label' => esc_html__( 'Archive - Category', 'splits' ),
'description' => esc_html__( '(is_category) Category archive layout', 'splits' ),
'section' => 'layout',
'default' => 'inherit',
'choices' => array(
@ -425,11 +425,11 @@ Kirki::add_field( 'split_theme', array(
),
) );
// Layout: Search
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'radio-image',
'settings' => 'layout-search',
'label' => esc_html__( 'Search', 'split' ),
'description' => esc_html__( '(is_search) Search page layout', 'split' ),
'label' => esc_html__( 'Search', 'splits' ),
'description' => esc_html__( '(is_search) Search page layout', 'splits' ),
'section' => 'layout',
'default' => 'inherit',
'choices' => array(
@ -439,11 +439,11 @@ Kirki::add_field( 'split_theme', array(
),
) );
// Layout: Error 404
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'radio-image',
'settings' => 'layout-404',
'label' => esc_html__( 'Error 404', 'split' ),
'description' => esc_html__( '(is_404) Error 404 page layout', 'split' ),
'label' => esc_html__( 'Error 404', 'splits' ),
'description' => esc_html__( '(is_404) Error 404 page layout', 'splits' ),
'section' => 'layout',
'default' => 'inherit',
'choices' => array(
@ -453,11 +453,11 @@ Kirki::add_field( 'split_theme', array(
),
) );
// Layout: Default Page
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'radio-image',
'settings' => 'layout-page',
'label' => esc_html__( 'Default Page', 'split' ),
'description' => esc_html__( '(is_page) Default page layout - If a page has a set layout, it will override this.', 'split' ),
'label' => esc_html__( 'Default Page', 'splits' ),
'description' => esc_html__( '(is_page) Default page layout - If a page has a set layout, it will override this.', 'splits' ),
'section' => 'layout',
'default' => 'inherit',
'choices' => array(
@ -468,7 +468,7 @@ Kirki::add_field( 'split_theme', array(
) );
function split_kirki_sidebars_select() {
function splits_kirki_sidebars_select() {
$sidebars = array();
if ( isset( $GLOBALS['wp_registered_sidebars'] ) ) {
$sidebars = $GLOBALS['wp_registered_sidebars'];
@ -481,184 +481,184 @@ function split_kirki_sidebars_select() {
return;
}
// Sidebars: Select
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'select',
'settings' => 's1-home',
'label' => esc_html__( 'Home', 'split' ),
'description' => esc_html__( '(is_home) Primary', 'split' ),
'label' => esc_html__( 'Home', 'splits' ),
'description' => esc_html__( '(is_home) Primary', 'splits' ),
'section' => 'sidebars',
'choices' => $sidebars_choices,
'default' => '',
'placeholder' => esc_html__( 'Select a sidebar', 'split' ),
'placeholder' => esc_html__( 'Select a sidebar', 'splits' ),
) );
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'select',
'settings' => 's1-single',
'label' => esc_html__( 'Single', 'split' ),
'description' => esc_html__( '(is_single) Primary - If a single post has a unique sidebar, it will override this.', 'split' ),
'label' => esc_html__( 'Single', 'splits' ),
'description' => esc_html__( '(is_single) Primary - If a single post has a unique sidebar, it will override this.', 'splits' ),
'section' => 'sidebars',
'choices' => $sidebars_choices,
'default' => '',
'placeholder' => esc_html__( 'Select a sidebar', 'split' ),
'placeholder' => esc_html__( 'Select a sidebar', 'splits' ),
) );
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'select',
'settings' => 's1-archive',
'label' => esc_html__( 'Archive', 'split' ),
'description' => esc_html__( '(is_archive) Primary', 'split' ),
'label' => esc_html__( 'Archive', 'splits' ),
'description' => esc_html__( '(is_archive) Primary', 'splits' ),
'section' => 'sidebars',
'choices' => $sidebars_choices,
'default' => '',
'placeholder' => esc_html__( 'Select a sidebar', 'split' ),
'placeholder' => esc_html__( 'Select a sidebar', 'splits' ),
) );
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'select',
'settings' => 's1-archive-category',
'label' => esc_html__( 'Archive - Category', 'split' ),
'description' => esc_html__( '(is_category) Primary', 'split' ),
'label' => esc_html__( 'Archive - Category', 'splits' ),
'description' => esc_html__( '(is_category) Primary', 'splits' ),
'section' => 'sidebars',
'choices' => $sidebars_choices,
'default' => '',
'placeholder' => esc_html__( 'Select a sidebar', 'split' ),
'placeholder' => esc_html__( 'Select a sidebar', 'splits' ),
) );
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'select',
'settings' => 's1-search',
'label' => esc_html__( 'Search', 'split' ),
'description' => esc_html__( '(is_search) Primary', 'split' ),
'label' => esc_html__( 'Search', 'splits' ),
'description' => esc_html__( '(is_search) Primary', 'splits' ),
'section' => 'sidebars',
'choices' => $sidebars_choices,
'default' => '',
'placeholder' => esc_html__( 'Select a sidebar', 'split' ),
'placeholder' => esc_html__( 'Select a sidebar', 'splits' ),
) );
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'select',
'settings' => 's1-404',
'label' => esc_html__( 'Error 404', 'split' ),
'description' => esc_html__( '(is_404) Primary', 'split' ),
'label' => esc_html__( 'Error 404', 'splits' ),
'description' => esc_html__( '(is_404) Primary', 'splits' ),
'section' => 'sidebars',
'choices' => $sidebars_choices,
'default' => '',
'placeholder' => esc_html__( 'Select a sidebar', 'split' ),
'placeholder' => esc_html__( 'Select a sidebar', 'splits' ),
) );
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'select',
'settings' => 's1-page',
'label' => esc_html__( 'Default Page', 'split' ),
'description' => esc_html__( '(is_page) Primary - If a page has a unique sidebar, it will override this.', 'split' ),
'label' => esc_html__( 'Default Page', 'splits' ),
'description' => esc_html__( '(is_page) Primary - If a page has a unique sidebar, it will override this.', 'splits' ),
'section' => 'sidebars',
'choices' => $sidebars_choices,
'default' => '',
'placeholder' => esc_html__( 'Select a sidebar', 'split' ),
'placeholder' => esc_html__( 'Select a sidebar', 'splits' ),
) );
}
add_action( 'init', 'split_kirki_sidebars_select', 999 );
add_action( 'init', 'splits_kirki_sidebars_select', 999 );
// Social Links: List
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'repeater',
'label' => esc_html__( 'Create Social Links', 'split' ),
'description' => esc_html__( 'Create and organize your social links', 'split' ),
'label' => esc_html__( 'Create Social Links', 'splits' ),
'description' => esc_html__( 'Create and organize your social links', 'splits' ),
'section' => 'social',
'tooltip' => esc_html__( 'Font Awesome names:', 'split' ) . ' <a href="https://fontawesome.com/v5/search?s=brands" target="_blank"><strong>' . esc_html__( 'View All', 'split' ) . ' </strong></a>',
'tooltip' => esc_html__( 'Font Awesome names:', 'splits' ) . ' <a href="https://fontawesome.com/v5/search?s=brands" target="_blank"><strong>' . esc_html__( 'View All', 'splits' ) . ' </strong></a>',
'row_label' => array(
'type' => 'text',
'value' => esc_html__('social link', 'split' ),
'value' => esc_html__('social link', 'splits' ),
),
'settings' => 'social-links',
'default' => '',
'fields' => array(
'social-title' => array(
'type' => 'text',
'label' => esc_html__( 'Title', 'split' ),
'description' => esc_html__( 'Ex: Facebook', 'split' ),
'label' => esc_html__( 'Title', 'splits' ),
'description' => esc_html__( 'Ex: Facebook', 'splits' ),
'default' => '',
),
'social-icon' => array(
'type' => 'text',
'label' => esc_html__( 'Icon Name', 'split' ),
'description' => esc_html__( 'Font Awesome icons. Ex: fa-facebook ', 'split' ) . ' <a href="https://fontawesome.com/v5/search?s=brands" target="_blank"><strong>' . esc_html__( 'View All', 'split' ) . ' </strong></a>',
'label' => esc_html__( 'Icon Name', 'splits' ),
'description' => esc_html__( 'Font Awesome icons. Ex: fa-facebook ', 'splits' ) . ' <a href="https://fontawesome.com/v5/search?s=brands" target="_blank"><strong>' . esc_html__( 'View All', 'splits' ) . ' </strong></a>',
'default' => 'fa-',
),
'social-link' => array(
'type' => 'link',
'label' => esc_html__( 'Link', 'split' ),
'description' => esc_html__( 'Enter the full url for your icon button', 'split' ),
'label' => esc_html__( 'Link', 'splits' ),
'description' => esc_html__( 'Enter the full url for your icon button', 'splits' ),
'default' => 'http://',
),
'social-color' => array(
'type' => 'color',
'label' => esc_html__( 'Icon Color', 'split' ),
'description' => esc_html__( 'Set a unique color for your icon (optional)', 'split' ),
'label' => esc_html__( 'Icon Color', 'splits' ),
'description' => esc_html__( 'Set a unique color for your icon (optional)', 'splits' ),
'default' => '',
),
'social-target' => array(
'type' => 'checkbox',
'label' => esc_html__( 'Open in new window', 'split' ),
'label' => esc_html__( 'Open in new window', 'splits' ),
'default' => false,
),
)
) );
// Styling: Enable
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'switch',
'settings' => 'dynamic-styles',
'label' => esc_html__( 'Dynamic Styles', 'split' ),
'description' => esc_html__( 'Turn on to use the styling options below', 'split' ),
'label' => esc_html__( 'Dynamic Styles', 'splits' ),
'description' => esc_html__( 'Turn on to use the styling options below', 'splits' ),
'section' => 'styling',
'default' => 'on',
) );
// Styling: Boxed Layout
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'switch',
'settings' => 'boxed',
'label' => esc_html__( 'Boxed Layout', 'split' ),
'description' => esc_html__( 'Use a boxed layout', 'split' ),
'label' => esc_html__( 'Boxed Layout', 'splits' ),
'description' => esc_html__( 'Use a boxed layout', 'splits' ),
'section' => 'styling',
'default' => 'off',
) );
// Styling: Font
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'select',
'settings' => 'font',
'label' => esc_html__( 'Font', 'split' ),
'description' => esc_html__( 'Select font for the theme', 'split' ),
'label' => esc_html__( 'Font', 'splits' ),
'description' => esc_html__( 'Select font for the theme', 'splits' ),
'section' => 'styling',
'default' => 'roboto',
'choices' => array(
'titillium-web' => esc_html__( 'Titillium Web, Latin (Self-hosted)', 'split' ),
'titillium-web-ext' => esc_html__( 'Titillium Web, Latin-Ext', 'split' ),
'droid-serif' => esc_html__( 'Droid Serif, Latin', 'split' ),
'source-sans-pro' => esc_html__( 'Source Sans Pro, Latin-Ext', 'split' ),
'lato' => esc_html__( 'Lato, Latin', 'split' ),
'raleway' => esc_html__( 'Raleway, Latin', 'split' ),
'ubuntu' => esc_html__( 'Ubuntu, Latin-Ext', 'split' ),
'ubuntu-cyr' => esc_html__( 'Ubuntu, Latin / Cyrillic-Ext', 'split' ),
'roboto' => esc_html__( 'Roboto, Latin-Ext', 'split' ),
'roboto-cyr' => esc_html__( 'Roboto, Latin / Cyrillic-Ext', 'split' ),
'roboto-condensed' => esc_html__( 'Roboto Condensed, Latin-Ext', 'split' ),
'roboto-condensed-cyr' => esc_html__( 'Roboto Condensed, Latin / Cyrillic-Ext', 'split' ),
'roboto-slab' => esc_html__( 'Roboto Slab, Latin-Ext', 'split' ),
'roboto-slab-cyr' => esc_html__( 'Roboto Slab, Latin / Cyrillic-Ext', 'split' ),
'playfair-display' => esc_html__( 'Playfair Display, Latin-Ext', 'split' ),
'playfair-display-cyr' => esc_html__( 'Playfair Display, Latin / Cyrillic', 'split' ),
'open-sans' => esc_html__( 'Open Sans, Latin-Ext', 'split' ),
'open-sans-cyr' => esc_html__( 'Open Sans, Latin / Cyrillic-Ext', 'split' ),
'pt-serif' => esc_html__( 'PT Serif, Latin-Ext', 'split' ),
'pt-serif-cyr' => esc_html__( 'PT Serif, Latin / Cyrillic-Ext', 'split' ),
'arial' => esc_html__( 'Arial', 'split' ),
'georgia' => esc_html__( 'Georgia', 'split' ),
'verdana' => esc_html__( 'Verdana', 'split' ),
'tahoma' => esc_html__( 'Tahoma', 'split' ),
'titillium-web' => esc_html__( 'Titillium Web, Latin (Self-hosted)', 'splits' ),
'titillium-web-ext' => esc_html__( 'Titillium Web, Latin-Ext', 'splits' ),
'droid-serif' => esc_html__( 'Droid Serif, Latin', 'splits' ),
'source-sans-pro' => esc_html__( 'Source Sans Pro, Latin-Ext', 'splits' ),
'lato' => esc_html__( 'Lato, Latin', 'splits' ),
'raleway' => esc_html__( 'Raleway, Latin', 'splits' ),
'ubuntu' => esc_html__( 'Ubuntu, Latin-Ext', 'splits' ),
'ubuntu-cyr' => esc_html__( 'Ubuntu, Latin / Cyrillic-Ext', 'splits' ),
'roboto' => esc_html__( 'Roboto, Latin-Ext', 'splits' ),
'roboto-cyr' => esc_html__( 'Roboto, Latin / Cyrillic-Ext', 'splits' ),
'roboto-condensed' => esc_html__( 'Roboto Condensed, Latin-Ext', 'splits' ),
'roboto-condensed-cyr' => esc_html__( 'Roboto Condensed, Latin / Cyrillic-Ext', 'splits' ),
'roboto-slab' => esc_html__( 'Roboto Slab, Latin-Ext', 'splits' ),
'roboto-slab-cyr' => esc_html__( 'Roboto Slab, Latin / Cyrillic-Ext', 'splits' ),
'playfair-display' => esc_html__( 'Playfair Display, Latin-Ext', 'splits' ),
'playfair-display-cyr' => esc_html__( 'Playfair Display, Latin / Cyrillic', 'splits' ),
'open-sans' => esc_html__( 'Open Sans, Latin-Ext', 'splits' ),
'open-sans-cyr' => esc_html__( 'Open Sans, Latin / Cyrillic-Ext', 'splits' ),
'pt-serif' => esc_html__( 'PT Serif, Latin-Ext', 'splits' ),
'pt-serif-cyr' => esc_html__( 'PT Serif, Latin / Cyrillic-Ext', 'splits' ),
'arial' => esc_html__( 'Arial', 'splits' ),
'georgia' => esc_html__( 'Georgia', 'splits' ),
'verdana' => esc_html__( 'Verdana', 'splits' ),
'tahoma' => esc_html__( 'Tahoma', 'splits' ),
),
) );
// Styling: Container Width
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'slider',
'settings' => 'container-width',
'label' => esc_html__( 'Website Max-width', 'split' ),
'description' => esc_html__( 'Max-width of the container.', 'split' ),
'label' => esc_html__( 'Website Max-width', 'splits' ),
'description' => esc_html__( 'Max-width of the container.', 'splits' ),
'section' => 'styling',
'default' => '1680',
'choices' => array(
@ -668,43 +668,43 @@ Kirki::add_field( 'split_theme', array(
),
) );
// Styling: Primary Color
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'color',
'settings' => 'color-1',
'label' => esc_html__( 'Primary Color', 'split' ),
'label' => esc_html__( 'Primary Color', 'splits' ),
'section' => 'styling',
'default' => '#cd483c',
) );
// Styling: Mobile Menu Color
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'color',
'settings' => 'color-mobile-menu',
'label' => esc_html__( 'Mobile Menu Color', 'split' ),
'label' => esc_html__( 'Mobile Menu Color', 'splits' ),
'section' => 'styling',
'default' => '#cd483c',
) );
// Styling: Footer Menu Color
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'color',
'settings' => 'color-footer-menu',
'label' => esc_html__( 'Footer Menu Color', 'split' ),
'label' => esc_html__( 'Footer Menu Color', 'splits' ),
'section' => 'styling',
'default' => '#222222',
) );
// Styling: Footer Background
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'color',
'settings' => 'color-footer',
'label' => esc_html__( 'Footer Background', 'split' ),
'label' => esc_html__( 'Footer Background', 'splits' ),
'section' => 'styling',
'default' => '#181818',
) );
// Styling: Header Logo Max-height
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'slider',
'settings' => 'logo-max-height',
'label' => esc_html__( 'Header Logo Image Max-height', 'split' ),
'description' => esc_html__( 'Your logo image should have the double height of this to be high resolution', 'split' ),
'label' => esc_html__( 'Header Logo Image Max-height', 'splits' ),
'description' => esc_html__( 'Your logo image should have the double height of this to be high resolution', 'splits' ),
'section' => 'styling',
'default' => '60',
'choices' => array(
@ -714,11 +714,11 @@ Kirki::add_field( 'split_theme', array(
),
) );
// Styling: Image Border Radius
Kirki::add_field( 'split_theme', array(
Kirki::add_field( 'splits_theme', array(
'type' => 'slider',
'settings' => 'image-border-radius',
'label' => esc_html__( 'Image Border Radius', 'split' ),
'description' => esc_html__( 'Give your thumbnails and layout images rounded corners', 'split' ),
'label' => esc_html__( 'Image Border Radius', 'splits' ),
'description' => esc_html__( 'Give your thumbnails and layout images rounded corners', 'splits' ),
'section' => 'styling',
'default' => '0',
'choices' => array(

View file

@ -1,626 +0,0 @@
<?php
/**
* Theme updater admin page and functions.
*
* @package EDD Sample Theme
*/
class EDD_Theme_Updater_Admin {
/**
* Variables required for the theme updater
*
* @since 1.0.0
* @type string
*/
protected $remote_api_url = null;
protected $theme_slug = null;
protected $version = null;
protected $author = null;
protected $download_id = null;
protected $renew_url = null;
protected $strings = null;
/**
* Initialize the class.
*
* @since 1.0.0
*/
function __construct( $config = array(), $strings = array() ) {
$config = wp_parse_args( $config, array(
'remote_api_url' => 'http://easydigitaldownloads.com',
'theme_slug' => get_template(),
'item_name' => '',
'license' => '',
'version' => '',
'author' => '',
'download_id' => '',
'renew_url' => '',
'beta' => false,
) );
/**
* Fires after the theme $config is setup.
*
* @since x.x.x
*
* @param array $config Array of EDD SL theme data.
*/
do_action( 'post_edd_sl_theme_updater_setup', $config );
// Set config arguments
$this->remote_api_url = $config['remote_api_url'];
$this->item_name = $config['item_name'];
$this->theme_slug = sanitize_key( $config['theme_slug'] );
$this->version = $config['version'];
$this->author = $config['author'];
$this->download_id = $config['download_id'];
$this->renew_url = $config['renew_url'];
$this->beta = $config['beta'];
// Populate version fallback
if ( '' == $config['version'] ) {
$theme = wp_get_theme( $this->theme_slug );
$this->version = $theme->get( 'Version' );
}
// Strings passed in from the updater config
$this->strings = $strings;
add_action( 'init', array( $this, 'updater' ) );
add_action( 'admin_init', array( $this, 'register_option' ) );
add_action( 'admin_init', array( $this, 'license_action' ) );
add_action( 'admin_menu', array( $this, 'license_menu' ) );
add_action( 'update_option_' . $this->theme_slug . '_license_key', array( $this, 'activate_license' ), 10, 2 );
add_filter( 'http_request_args', array( $this, 'disable_wporg_request' ), 5, 2 );
}
/**
* Creates the updater class.
*
* since 1.0.0
*/
function updater() {
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
/* If there is no valid license key status, don't allow updates. */
if ( get_option( $this->theme_slug . '_license_key_status', false) != 'valid' ) {
return;
}
if ( !class_exists( 'EDD_Theme_Updater' ) ) {
// Load our custom theme updater
include( dirname( __FILE__ ) . '/theme-updater-class.php' );
}
new EDD_Theme_Updater(
array(
'remote_api_url' => $this->remote_api_url,
'version' => $this->version,
'license' => trim( get_option( $this->theme_slug . '_license_key' ) ),
'item_name' => $this->item_name,
'author' => $this->author,
'beta' => $this->beta
),
$this->strings
);
}
/**
* Adds a menu item for the theme license under the appearance menu.
*
* since 1.0.0
*/
function license_menu() {
$strings = $this->strings;
add_theme_page(
$strings['theme-license'],
$strings['theme-license'],
'manage_options',
$this->theme_slug . '-license',
array( $this, 'license_page' )
);
}
/**
* Outputs the markup used on the theme license page.
*
* since 1.0.0
*/
function license_page() {
$strings = $this->strings;
$license = trim( get_option( $this->theme_slug . '_license_key' ) );
$status = get_option( $this->theme_slug . '_license_key_status', false );
// Checks license status to display under license key
if ( ! $license ) {
$message = $strings['enter-key'];
} else {
// delete_transient( $this->theme_slug . '_license_message' );
if ( ! get_transient( $this->theme_slug . '_license_message', false ) ) {
set_transient( $this->theme_slug . '_license_message', $this->check_license(), ( 60 * 60 * 24 ) );
}
$message = get_transient( $this->theme_slug . '_license_message' );
}
?>
<div class="wrap">
<h2><?php echo $strings['theme-license'] ?></h2>
<form method="post" action="options.php">
<?php settings_fields( $this->theme_slug . '-license' ); ?>
<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row" valign="top">
<?php echo $strings['license-key']; ?>
</th>
<td>
<input id="<?php echo $this->theme_slug; ?>_license_key" name="<?php echo $this->theme_slug; ?>_license_key" type="text" class="regular-text" value="<?php echo esc_attr( $license ); ?>" />
<p class="description">
<?php echo $message; ?>
</p>
</td>
</tr>
<?php if ( $license ) { ?>
<tr valign="top">
<th scope="row" valign="top">
<?php echo $strings['license-action']; ?>
</th>
<td>
<?php
wp_nonce_field( $this->theme_slug . '_nonce', $this->theme_slug . '_nonce' );
if ( 'valid' == $status ) { ?>
<input type="submit" class="button-secondary" name="<?php echo $this->theme_slug; ?>_license_deactivate" value="<?php esc_attr_e( $strings['deactivate-license'] ); ?>"/>
<?php } else { ?>
<input type="submit" class="button-secondary" name="<?php echo $this->theme_slug; ?>_license_activate" value="<?php esc_attr_e( $strings['activate-license'] ); ?>"/>
<?php }
?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php submit_button(); ?>
</form>
<?php
}
/**
* Registers the option used to store the license key in the options table.
*
* since 1.0.0
*/
function register_option() {
register_setting(
$this->theme_slug . '-license',
$this->theme_slug . '_license_key',
array( $this, 'sanitize_license' )
);
}
/**
* Sanitizes the license key.
*
* since 1.0.0
*
* @param string $new License key that was submitted.
* @return string $new Sanitized license key.
*/
function sanitize_license( $new ) {
$old = get_option( $this->theme_slug . '_license_key' );
if ( $old && $old != $new ) {
// New license has been entered, so must reactivate
delete_option( $this->theme_slug . '_license_key_status' );
delete_transient( $this->theme_slug . '_license_message' );
}
return $new;
}
/**
* Makes a call to the API.
*
* @since 1.0.0
*
* @param array $api_params to be used for wp_remote_get.
* @return array $response decoded JSON response.
*/
function get_api_response( $api_params ) {
// Call the custom API.
$verify_ssl = (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true );
$response = wp_remote_post( $this->remote_api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
return $response;
}
/**
* Activates the license key.
*
* @since 1.0.0
*/
function activate_license() {
$license = trim( get_option( $this->theme_slug . '_license_key' ) );
// Data to send in our API request.
$api_params = array(
'edd_action' => 'activate_license',
'license' => $license,
'item_name' => urlencode( $this->item_name ),
'url' => home_url()
);
$response = $this->get_api_response( $api_params );
// make sure the response came back okay
if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
if ( is_wp_error( $response ) ) {
$message = $response->get_error_message();
} else {
$message = __( 'An error occurred, please try again.' );
}
$base_url = admin_url( 'themes.php?page=' . $this->theme_slug . '-license' );
$redirect = add_query_arg( array( 'sl_theme_activation' => 'false', 'message' => urlencode( $message ) ), $base_url );
wp_redirect( $redirect );
exit();
} else {
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
if ( false === $license_data->success ) {
switch( $license_data->error ) {
case 'expired' :
$message = sprintf(
__( 'Your license key expired on %s.' ),
date_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) )
);
break;
case 'disabled':
case 'revoked' :
$message = __( 'Your license key has been disabled.' );
break;
case 'missing' :
$message = __( 'Invalid license.' );
break;
case 'invalid' :
case 'site_inactive' :
$message = __( 'Your license is not active for this URL.' );
break;
case 'item_name_mismatch' :
$message = sprintf( __( 'This appears to be an invalid license key for %s.' ), $this->item_name );
break;
case 'no_activations_left':
$message = __( 'Your license key has reached its activation limit.' );
break;
default :
$message = __( 'An error occurred, please try again.' );
break;
}
if ( ! empty( $message ) ) {
$base_url = admin_url( 'themes.php?page=' . $this->theme_slug . '-license' );
$redirect = add_query_arg( array( 'sl_theme_activation' => 'false', 'message' => urlencode( $message ) ), $base_url );
wp_redirect( $redirect );
exit();
}
}
}
// $response->license will be either "active" or "inactive"
if ( $license_data && isset( $license_data->license ) ) {
update_option( $this->theme_slug . '_license_key_status', $license_data->license );
delete_transient( $this->theme_slug . '_license_message' );
}
wp_redirect( admin_url( 'themes.php?page=' . $this->theme_slug . '-license' ) );
exit();
}
/**
* Deactivates the license key.
*
* @since 1.0.0
*/
function deactivate_license() {
// Retrieve the license from the database.
$license = trim( get_option( $this->theme_slug . '_license_key' ) );
// Data to send in our API request.
$api_params = array(
'edd_action' => 'deactivate_license',
'license' => $license,
'item_name' => urlencode( $this->item_name ),
'url' => home_url()
);
$response = $this->get_api_response( $api_params );
// make sure the response came back okay
if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
if ( is_wp_error( $response ) ) {
$message = $response->get_error_message();
} else {
$message = __( 'An error occurred, please try again.' );
}
$base_url = admin_url( 'themes.php?page=' . $this->theme_slug . '-license' );
$redirect = add_query_arg( array( 'sl_theme_activation' => 'false', 'message' => urlencode( $message ) ), $base_url );
wp_redirect( $redirect );
exit();
} else {
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
// $license_data->license will be either "deactivated" or "failed"
if ( $license_data && ( $license_data->license == 'deactivated' ) ) {
delete_option( $this->theme_slug . '_license_key_status' );
delete_transient( $this->theme_slug . '_license_message' );
}
}
if ( ! empty( $message ) ) {
$base_url = admin_url( 'themes.php?page=' . $this->theme_slug . '-license' );
$redirect = add_query_arg( array( 'sl_theme_activation' => 'false', 'message' => urlencode( $message ) ), $base_url );
wp_redirect( $redirect );
exit();
}
wp_redirect( admin_url( 'themes.php?page=' . $this->theme_slug . '-license' ) );
exit();
}
/**
* Constructs a renewal link
*
* @since 1.0.0
*/
function get_renewal_link() {
// If a renewal link was passed in the config, use that
if ( '' != $this->renew_url ) {
return $this->renew_url;
}
// If download_id was passed in the config, a renewal link can be constructed
$license_key = trim( get_option( $this->theme_slug . '_license_key', false ) );
if ( '' != $this->download_id && $license_key ) {
$url = esc_url( $this->remote_api_url );
$url .= '/checkout/?edd_license_key=' . $license_key . '&download_id=' . $this->download_id;
return $url;
}
// Otherwise return the remote_api_url
return $this->remote_api_url;
}
/**
* Checks if a license action was submitted.
*
* @since 1.0.0
*/
function license_action() {
if ( isset( $_POST[ $this->theme_slug . '_license_activate' ] ) ) {
if ( check_admin_referer( $this->theme_slug . '_nonce', $this->theme_slug . '_nonce' ) ) {
$this->activate_license();
}
}
if ( isset( $_POST[$this->theme_slug . '_license_deactivate'] ) ) {
if ( check_admin_referer( $this->theme_slug . '_nonce', $this->theme_slug . '_nonce' ) ) {
$this->deactivate_license();
}
}
}
/**
* Checks if license is valid and gets expire date.
*
* @since 1.0.0
*
* @return string $message License status message.
*/
function check_license() {
$license = trim( get_option( $this->theme_slug . '_license_key' ) );
$strings = $this->strings;
$api_params = array(
'edd_action' => 'check_license',
'license' => $license,
'item_name' => urlencode( $this->item_name ),
'url' => home_url()
);
$response = $this->get_api_response( $api_params );
// make sure the response came back okay
if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
if ( is_wp_error( $response ) ) {
$message = $response->get_error_message();
} else {
$message = $strings['license-status-unknown'];
}
$base_url = admin_url( 'themes.php?page=' . $this->theme_slug . '-license' );
$redirect = add_query_arg( array( 'sl_theme_activation' => 'false', 'message' => urlencode( $message ) ), $base_url );
wp_redirect( $redirect );
exit();
} else {
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
// If response doesn't include license data, return
if ( !isset( $license_data->license ) ) {
$message = $strings['license-status-unknown'];
return $message;
}
// We need to update the license status at the same time the message is updated
if ( $license_data && isset( $license_data->license ) ) {
update_option( $this->theme_slug . '_license_key_status', $license_data->license );
}
// Get expire date
$expires = false;
if ( isset( $license_data->expires ) && 'lifetime' != $license_data->expires ) {
$expires = date_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) );
$renew_link = '<a href="' . esc_url( $this->get_renewal_link() ) . '" target="_blank">' . $strings['renew'] . '</a>';
} elseif ( isset( $license_data->expires ) && 'lifetime' == $license_data->expires ) {
$expires = 'lifetime';
}
// Get site counts
$site_count = $license_data->site_count;
$license_limit = $license_data->license_limit;
// If unlimited
if ( 0 == $license_limit ) {
$license_limit = $strings['unlimited'];
}
if ( $license_data->license == 'valid' ) {
$message = $strings['license-key-is-active'] . ' ';
if ( isset( $expires ) && 'lifetime' != $expires ) {
$message .= sprintf( $strings['expires%s'], $expires ) . ' ';
}
if ( isset( $expires ) && 'lifetime' == $expires ) {
$message .= $strings['expires-never'];
}
if ( $site_count && $license_limit ) {
$message .= sprintf( $strings['%1$s/%2$-sites'], $site_count, $license_limit );
}
} else if ( $license_data->license == 'expired' ) {
if ( $expires ) {
$message = sprintf( $strings['license-key-expired-%s'], $expires );
} else {
$message = $strings['license-key-expired'];
}
if ( $renew_link ) {
$message .= ' ' . $renew_link;
}
} else if ( $license_data->license == 'invalid' ) {
$message = $strings['license-keys-do-not-match'];
} else if ( $license_data->license == 'inactive' ) {
$message = $strings['license-is-inactive'];
} else if ( $license_data->license == 'disabled' ) {
$message = $strings['license-key-is-disabled'];
} else if ( $license_data->license == 'site_inactive' ) {
// Site is inactive
$message = $strings['site-is-inactive'];
} else {
$message = $strings['license-status-unknown'];
}
}
return $message;
}
/**
* Disable requests to wp.org repository for this theme.
*
* @since 1.0.0
*/
function disable_wporg_request( $r, $url ) {
// If it's not a theme update request, bail.
if ( 0 !== strpos( $url, 'https://api.wordpress.org/themes/update-check/1.1/' ) ) {
return $r;
}
// Decode the JSON response
$themes = json_decode( $r['body']['themes'] );
// Remove the active parent and child themes from the check
$parent = get_option( 'template' );
$child = get_option( 'stylesheet' );
unset( $themes->themes->$parent );
unset( $themes->themes->$child );
// Encode the updated JSON response
$r['body']['themes'] = json_encode( $themes );
return $r;
}
}
/**
* This is a means of catching errors from the activation method above and displyaing it to the customer
*/
function edd_sample_theme_admin_notices() {
if ( isset( $_GET['sl_theme_activation'] ) && ! empty( $_GET['message'] ) ) {
switch( $_GET['sl_theme_activation'] ) {
case 'false':
$message = urldecode( $_GET['message'] );
?>
<div class="error">
<p><?php echo $message; ?></p>
</div>
<?php
break;
case 'true':
default:
break;
}
}
}
add_action( 'admin_notices', 'edd_sample_theme_admin_notices' );

View file

@ -1,192 +0,0 @@
<?php
/**
* Theme updater class.
*
* @package EDD Sample Theme
* @version 1.0.3
*/
class EDD_Theme_Updater {
private $remote_api_url;
private $request_data;
private $response_key;
private $theme_slug;
private $license_key;
private $version;
private $author;
protected $strings = null;
/**
* Initiate the Theme updater
*
* @param array $args Array of arguments from the theme requesting an update check
* @param array $strings Strings for the update process
*/
function __construct( $args = array(), $strings = array() ) {
$defaults = array(
'remote_api_url' => 'http://easydigitaldownloads.com',
'request_data' => array(),
'theme_slug' => get_template(), // use get_stylesheet() for child theme updates
'item_name' => '',
'license' => '',
'version' => '',
'author' => '',
'beta' => false,
);
$args = wp_parse_args( $args, $defaults );
$this->license = $args['license'];
$this->item_name = $args['item_name'];
$this->version = $args['version'];
$this->theme_slug = sanitize_key( $args['theme_slug'] );
$this->author = $args['author'];
$this->beta = $args['beta'];
$this->remote_api_url = $args['remote_api_url'];
$this->response_key = $this->theme_slug . '-' . $this->beta . '-update-response';
$this->strings = $strings;
add_filter( 'site_transient_update_themes', array( $this, 'theme_update_transient' ) );
add_filter( 'delete_site_transient_update_themes', array( $this, 'delete_theme_update_transient' ) );
add_action( 'load-update-core.php', array( $this, 'delete_theme_update_transient' ) );
add_action( 'load-themes.php', array( $this, 'delete_theme_update_transient' ) );
add_action( 'load-themes.php', array( $this, 'load_themes_screen' ) );
}
/**
* Show the update notification when neecessary
*
* @return void
*/
function load_themes_screen() {
add_thickbox();
add_action( 'admin_notices', array( $this, 'update_nag' ) );
}
/**
* Display the update notifications
*
* @return void
*/
function update_nag() {
$strings = $this->strings;
$theme = wp_get_theme( $this->theme_slug );
$api_response = get_transient( $this->response_key );
if ( false === $api_response ) {
return;
}
$update_url = wp_nonce_url( 'update.php?action=upgrade-theme&amp;theme=' . urlencode( $this->theme_slug ), 'upgrade-theme_' . $this->theme_slug );
$update_onclick = ' onclick="if ( confirm(\'' . esc_js( $strings['update-notice'] ) . '\') ) {return true;}return false;"';
if ( version_compare( $this->version, $api_response->new_version, '<' ) ) {
echo '<div id="update-nag">';
printf(
$strings['update-available'],
$theme->get( 'Name' ),
$api_response->new_version,
'#TB_inline?width=640&amp;inlineId=' . $this->theme_slug . '_changelog',
$theme->get( 'Name' ),
$update_url,
$update_onclick
);
echo '</div>';
echo '<div id="' . $this->theme_slug . '_' . 'changelog" style="display:none;">';
echo wpautop( $api_response->sections['changelog'] );
echo '</div>';
}
}
/**
* Update the theme update transient with the response from the version check
*
* @param array $value The default update values.
* @return array|boolean If an update is available, returns the update parameters, if no update is needed returns false, if
* the request fails returns false.
*/
function theme_update_transient( $value ) {
$update_data = $this->check_for_update();
if ( $update_data ) {
// Make sure the theme property is set. See issue 1463 on Github in the Software Licensing Repo.
$update_data['theme'] = $this->theme_slug;
$value->response[ $this->theme_slug ] = $update_data;
}
return $value;
}
/**
* Remove the update data for the theme
*
* @return void
*/
function delete_theme_update_transient() {
delete_transient( $this->response_key );
}
/**
* Call the EDD SL API (using the URL in the construct) to get the latest version information
*
* @return array|boolean If an update is available, returns the update parameters, if no update is needed returns false, if
* the request fails returns false.
*/
function check_for_update() {
$update_data = get_transient( $this->response_key );
if ( false === $update_data ) {
$failed = false;
$api_params = array(
'edd_action' => 'get_version',
'license' => $this->license,
'name' => $this->item_name,
'slug' => $this->theme_slug,
'version' => $this->version,
'author' => $this->author,
'beta' => $this->beta
);
$response = wp_remote_post( $this->remote_api_url, array( 'timeout' => 15, 'body' => $api_params ) );
// Make sure the response was successful
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
$failed = true;
}
$update_data = json_decode( wp_remote_retrieve_body( $response ) );
if ( ! is_object( $update_data ) ) {
$failed = true;
}
// If the response failed, try again in 30 minutes
if ( $failed ) {
$data = new stdClass;
$data->new_version = $this->version;
set_transient( $this->response_key, $data, strtotime( '+30 minutes', time() ) );
return false;
}
// If the status is 'ok', return the update arguments
if ( ! $failed ) {
$update_data->sections = maybe_unserialize( $update_data->sections );
set_transient( $this->response_key, $update_data, strtotime( '+12 hours', time() ) );
}
}
if ( version_compare( $this->version, $update_data->new_version, '>=' ) ) {
return false;
}
return (array) $update_data;
}
}

View file

@ -1,54 +0,0 @@
<?php
/**
* Easy Digital Downloads Theme Updater
*
* @package EDD Sample Theme
*/
// Includes the files needed for the theme updater
if ( !class_exists( 'EDD_Theme_Updater_Admin' ) ) {
include( dirname( __FILE__ ) . '/theme-updater-admin.php' );
}
// Loads the updater classes
$updater = new EDD_Theme_Updater_Admin(
// Config settings
$config = array(
'remote_api_url' => 'https://alx.media', // Site where EDD is hosted
'item_name' => 'Split', // Name of theme
'theme_slug' => 'split', // Theme slug
'version' => '1.4.9', // The current version of this theme
'author' => 'AlxMedia', // The author of this theme
'download_id' => '', // Optional, used for generating a license renewal link
'renew_url' => '', // Optional, allows for a custom license renewal link
'beta' => false, // Optional, set to true to opt into beta versions
),
// Strings
$strings = array(
'theme-license' => __( 'Theme License', 'split' ),
'enter-key' => __( 'Enter your theme license key.', 'split' ),
'license-key' => __( 'License Key', 'split' ),
'license-action' => __( 'License Action', 'split' ),
'deactivate-license' => __( 'Deactivate License', 'split' ),
'activate-license' => __( 'Activate License', 'split' ),
'status-unknown' => __( 'License status is unknown.', 'split' ),
'renew' => __( 'Renew?', 'split' ),
'unlimited' => __( 'unlimited', 'split' ),
'license-key-is-active' => __( 'License key is active.', 'split' ),
'expires%s' => __( 'Expires %s.', 'split' ),
'expires-never' => __( 'Lifetime License.', 'split' ),
'%1$s/%2$-sites' => __( 'You have %1$s / %2$s sites activated.', 'split' ),
'license-key-expired-%s' => __( 'License key expired %s.', 'split' ),
'license-key-expired' => __( 'License key has expired.', 'split' ),
'license-keys-do-not-match' => __( 'License keys do not match.', 'split' ),
'license-is-inactive' => __( 'License is inactive.', 'split' ),
'license-key-is-disabled' => __( 'License key is disabled.', 'split' ),
'site-is-inactive' => __( 'Site is inactive.', 'split' ),
'license-status-unknown' => __( 'License status is unknown.', 'split' ),
'update-notice' => __( "Updating this theme will lose any customizations you have made. 'Cancel' to stop, 'OK' to update.", 'split' ),
'update-available' => __('<strong>%1$s %2$s</strong> is available. <a href="%3$s" class="thickbox" title="%4s">Check out what\'s new</a> or <a href="%5$s"%6$s>update now</a>.', 'split' ),
)
);