Skip to content

Commit

Permalink
add ACF include file, all ACF functions going in there from now
Browse files Browse the repository at this point in the history
  • Loading branch information
neilgee committed Mar 17, 2019
1 parent 086f11a commit aa9c519
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 43 deletions.
13 changes: 12 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ function bt_theme_setup() {
if ( class_exists( 'GFCommon' ) ) {
include_once( get_stylesheet_directory() . '/includes-child/gravity.php' );
}

/**
* Load in ACF functions
* @since 1.7.0
*/
if ( class_exists( 'acf' ) ) {
include_once( get_stylesheet_directory() . '/includes-child/acf.php' );
}

/**
* Get the plugins ffrom TGM Plugin Activation
Expand Down Expand Up @@ -239,7 +247,10 @@ function bt_execute_php_widgets( $html ) {

}
add_filter( 'fl_ace_editor_settings', 'custom_ace_editor' );

/**
* Show line numbers and wrap text in Ace editor
* @since 1.7.0
*/
function custom_ace_editor() {
$change_ace = array(
'showLineNumbers' => true,
Expand Down
30 changes: 30 additions & 0 deletions includes-child/acf.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* Add ACF functions
* @since 1.7.0
*/



add_action('after_switch_theme', 'bt_acf_auto_set_license_keys');
/**
* ACF License - via constant defined in wp-config.php
* @link https://gist.github.com/mattradford/6d5b8f3cd11ce1f62480
*
* @since 1.0.0
*/
function bt_acf_auto_set_license_keys() {

if ( !get_option('acf_pro_license') && defined('ACF_PRO_KEY') ) {

$save = array(
'key' => ACF_PRO_KEY,
'url' => home_url()
);

$save = maybe_serialize($save);
$save = base64_encode($save);

update_option('acf_pro_license', $save);
}
}
51 changes: 14 additions & 37 deletions includes-child/client-file.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Client File - Custonm Login and Dashboard Settings
* Client File - Custom Login and Dashboard Settings
*
* @package beavertron
* @author NeilGee
Expand Down Expand Up @@ -88,18 +88,19 @@ function bt_remove_dashboard_widgets() {
* @since 1.0.0
*/
function bt_hide_tabs() {

if ( ! current_user_can( 'activate_plugins' )) {
echo '
<style type="text/css">
#wp-admin-bar-wp-logo,
#wp-admin-bar-comments,
#wp-admin-bar-new-content,
#contextual-help-link-wrap,
#screen-options-link-wrap {
display: none !important;
}
</style>
';
echo '
<style type="text/css">
#wp-admin-bar-wp-logo,
#wp-admin-bar-comments,
#wp-admin-bar-new-content,
#contextual-help-link-wrap,
#screen-options-link-wrap {
display: none !important;
}
</style>
';
}
}

Expand All @@ -117,30 +118,6 @@ function wsl_edit_text() {
return "<em>Site by <a href='https://websitelove.com.au' rel='nofollow'>WebsiteLove</a>, contact <a href='mailto:[email protected]' rel='nofollow'>us</a></em>";
}


add_action('after_switch_theme', 'bt_acf_auto_set_license_keys');
/**
* ACF License - via constant defined in wp-config.php
* @link https://gist.github.com/mattradford/6d5b8f3cd11ce1f62480
*
* @since 1.0.0
*/
function bt_acf_auto_set_license_keys() {

if ( !get_option('acf_pro_license') && defined('ACF_PRO_KEY') ) {

$save = array(
'key' => ACF_PRO_KEY,
'url' => home_url()
);

$save = maybe_serialize($save);
$save = base64_encode($save);

update_option('acf_pro_license', $save);
}
}

/**
* Roles & Capabilities
* @link https://wordpress.stackexchange.com/questions/4191/allow-editors-to-edit-menus
Expand All @@ -151,4 +128,4 @@ function bt_acf_auto_set_license_keys() {
// $role_object = get_role( 'editor' );

// add $cap capability to this role object
// $role_object->add_cap( 'edit_theme_options' );
// $role_object->add_cap( 'edit_theme_options' );
8 changes: 4 additions & 4 deletions plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function gsm_register_required_plugins() {
'slug' => 'advanced-custom-fields', // The plugin slug (typically the folder name).
'source' => get_theme_root() . '/lib/plugins/advanced-custom-fields-pro.zip', // The plugin source.
'required' => false, // If false, the plugin is only 'recommended' instead of required.
'version' => '5.7.10', // E.g. 1.0.0. If set, the active plugin must be this version or higher.
'version' => '5.7.13', // E.g. 1.0.0. If set, the active plugin must be this version or higher.
'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch.
'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins.
'external_url' => '', // If set, overrides default API URL and points to an external URL.
Expand All @@ -87,7 +87,7 @@ function gsm_register_required_plugins() {
'slug' => 'bb-ultimate-addon', // The plugin slug (typically the folder name).
'source' => get_theme_root() . '/lib/plugins/bb-ultimate-addon.zip', // The plugin source.
'required' => false, // If false, the plugin is only 'recommended' instead of required.
'version' => '1.14.3', // E.g. 1.0.0. If set, the active plugin must be this version or higher.
'version' => '1.16.0', // E.g. 1.0.0. If set, the active plugin must be this version or higher.
'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch.
'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins.
'external_url' => '', // If set, overrides default API URL and points to an external URL.
Expand All @@ -109,9 +109,9 @@ function gsm_register_required_plugins() {
array(
'name' => 'Gravity Forms', // The plugin name.
'slug' => 'gravityforms', // The plugin slug (typically the folder name).
'source' => get_theme_root() . '/lib/plugins/gravityforms_2.4.2.4.zip', // The plugin source.
'source' => get_theme_root() . '/lib/plugins/gravityforms_2.4.6.11.zip', // The plugin source.
'required' => false, // If false, the plugin is only 'recommended' instead of required.
'version' => '2.4.5.4', // E.g. 1.0.0. If set, the active plugin must be this version or higher.
'version' => '2.4.6.11', // E.g. 1.0.0. If set, the active plugin must be this version or higher.
'force_activation' => false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch.
'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins.
'external_url' => '', // If set, overrides default API URL and points to an external URL.
Expand Down
3 changes: 2 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,8 @@ li.comment {
.site-footer-widgets-row .fl-heading,
.site-footer-widgets-row .fl-icon-group-left,
.site-footer-widgets-row .menu li,
.site-footer-widgets-row .fl-rich-text p {
.site-footer-widgets-row .fl-rich-text p,
.site-footer-widgets-row .fl-module-icon {
text-align: center !important;
}
.site-footer-widgets-row .uabb-business-hours-wrap {
Expand Down

0 comments on commit aa9c519

Please sign in to comment.