modified file bootstrap-buttons.css

This commit is contained in:
2023-12-08 23:23:36 +00:00
committed by Gitium
parent 33d18af972
commit 3f4d8b933f
2304 changed files with 24432 additions and 417943 deletions
wp-content/upgrade-temp-backup/plugins
activitypub
authldap
gitium
gp-premium
backgrounds
blog
colors
copyright
disable-elements
dist
elements
general
gp-premium.php
hooks
inc
langs
gp-premium-ar.mogp-premium-bn_BD.mogp-premium-cs_CZ.mogp-premium-da_DK.mogp-premium-de_DE-42da344ccb044413769d16ed3484307b.jsongp-premium-de_DE-53e2a1d5945b8d2b1c35e81ae1e532f3.jsongp-premium-de_DE-92fa58377f1b6f7bef9c785c31ae29ff.jsongp-premium-de_DE.mogp-premium-es_AR.mogp-premium-es_ES-42da344ccb044413769d16ed3484307b.jsongp-premium-es_ES-53e2a1d5945b8d2b1c35e81ae1e532f3.jsongp-premium-es_ES-92fa58377f1b6f7bef9c785c31ae29ff.jsongp-premium-es_ES-cbab080b0f20fd6c323029398be6c986.jsongp-premium-es_ES-ecf9f3c2af10c4f2dfbf4f42504922d1.jsongp-premium-es_ES.mogp-premium-fi-42da344ccb044413769d16ed3484307b.jsongp-premium-fi-53e2a1d5945b8d2b1c35e81ae1e532f3.jsongp-premium-fi-92fa58377f1b6f7bef9c785c31ae29ff.jsongp-premium-fi-cbab080b0f20fd6c323029398be6c986.jsongp-premium-fi-ecf9f3c2af10c4f2dfbf4f42504922d1.jsongp-premium-fi.mogp-premium-fr_FR-42da344ccb044413769d16ed3484307b.jsongp-premium-fr_FR-53e2a1d5945b8d2b1c35e81ae1e532f3.jsongp-premium-fr_FR-92fa58377f1b6f7bef9c785c31ae29ff.jsongp-premium-fr_FR.mogp-premium-hr.mogp-premium-hu_HU.mogp-premium-it_IT.mogp-premium-nb_NO.mogp-premium-nl_NL-42da344ccb044413769d16ed3484307b.jsongp-premium-nl_NL-53e2a1d5945b8d2b1c35e81ae1e532f3.jsongp-premium-nl_NL-92fa58377f1b6f7bef9c785c31ae29ff.jsongp-premium-nl_NL-cbab080b0f20fd6c323029398be6c986.jsongp-premium-nl_NL-ecf9f3c2af10c4f2dfbf4f42504922d1.jsongp-premium-nl_NL.mogp-premium-pl_PL.mogp-premium-pt_BR.mogp-premium-pt_PT-42da344ccb044413769d16ed3484307b.jsongp-premium-pt_PT-53e2a1d5945b8d2b1c35e81ae1e532f3.jsongp-premium-pt_PT-92fa58377f1b6f7bef9c785c31ae29ff.jsongp-premium-pt_PT.mogp-premium-ru_RU-42da344ccb044413769d16ed3484307b.jsongp-premium-ru_RU-53e2a1d5945b8d2b1c35e81ae1e532f3.jsongp-premium-ru_RU-92fa58377f1b6f7bef9c785c31ae29ff.jsongp-premium-ru_RU.mogp-premium-sv_SE-42da344ccb044413769d16ed3484307b.jsongp-premium-sv_SE-53e2a1d5945b8d2b1c35e81ae1e532f3.jsongp-premium-sv_SE-92fa58377f1b6f7bef9c785c31ae29ff.jsongp-premium-sv_SE-cbab080b0f20fd6c323029398be6c986.jsongp-premium-sv_SE-ecf9f3c2af10c4f2dfbf4f42504922d1.jsongp-premium-sv_SE.mogp-premium-uk.mogp-premium-vi.mogp-premium-zh_CN.mo
library
menu-plus
page-header
readme.txt
secondary-nav
sections
site-library
spacing
typography
woocommerce
wpml-config.xml
jetpack-protect
CHANGELOG.mdLICENSE.txtSECURITY.md
assets
build
composer.jsonjetpack-protect.php
jetpack_vendor
automattic
jetpack-a8c-mc-stats
jetpack-admin-ui
jetpack-assets
jetpack-config
jetpack-connection
jetpack-constants
jetpack-device-detection
jetpack-identity-crisis
jetpack-ip
jetpack-jitm
jetpack-licensing
jetpack-logo
jetpack-my-jetpack
jetpack-partner
jetpack-password-checker
jetpack-plugins-installer
jetpack-redirect
jetpack-roles
jetpack-status
jetpack-sync
jetpack-transport-helper
jetpack-waf
i18n-map.php
readme.txt
src
vendor
menu-icons
CHANGELOG.mdCONTRIBUTING.mdLICENSE
css
images
includes
js
languages
mailin.phpmenu-icons.phpreadme.mdreadme.txt
vendor
autoload.php
codeinwp
gutenberg-menu-icons
icon-picker
menu-item-custom-fields
themeisle-sdk
composer
simple-local-avatars
smtp-mailer
two-factor
w3-total-cache
BrowserCache_Environment_Nginx.phpBrowserCache_Page_View_SectionSecurity.phpBrowserCache_Plugin.phpCacheFlush.phpCacheFlush_Locally.phpCacheGroups_Plugin_Admin.phpCacheGroups_Plugin_Admin_View.jsCacheGroups_Plugin_Admin_View.phpCache_File_Generic.phpCdn_AdminActions.phpCdn_GeneralPage_View.phpCdn_Highwinds_Widget_View.phpCdn_Highwinds_Widget_View_NotConfigured.phpCdn_Plugin.phpCdn_StackPath2_Page_View.phpCdn_StackPath2_Widget_View_Authorized.phpCdn_StackPath2_Widget_View_Unauthorized.phpCdn_StackPath_Page_View.phpCdn_StackPath_Widget_View_Authorized.phpCdn_StackPath_Widget_View_Unauthorized.phpCdnfsd_CloudFront_Page_View.phpCdnfsd_GeneralPage_View.phpCdnfsd_LimeLight_Page_View.phpCdnfsd_StackPath2_Page_View.phpCdnfsd_StackPath_Page_View.phpCdnfsd_TransparentCDN_Page_View.phpConfigCompiler.phpConfigKeys.phpDbCache_Environment.phpDbCache_Page.phpDbCache_Plugin.phpDbCache_Wpdb.phpDbCache_WpdbNew.phpDispatcher.phpExtension_Amp_Page_View.phpExtension_CloudFlare_Cdn_Page_View.phpExtension_CloudFlare_GeneralPage_View.phpExtension_CloudFlare_Page_View.phpExtension_CloudFlare_Plugin_Admin.phpExtension_FragmentCache_GeneralPage_View.phpExtension_FragmentCache_Page_View.phpExtension_FragmentCache_Plugin.phpExtension_FragmentCache_Plugin_Admin.phpExtension_Genesis_Page_View.phpExtension_ImageService_Page_View.phpExtension_ImageService_Plugin_Admin.phpExtension_NewRelic_GeneralPage_View.phpExtension_NewRelic_Page_View_Apm.phpExtension_Swarmify_Page_View.phpExtension_Wpml_Plugin_Admin.phpExtensions_Plugin_Admin.phpFeatureShowcase_Plugin_Admin.phpFeatureShowcase_Plugin_Admin_View.phpGeneric_AdminActions_Default.phpGeneric_AdminActions_Flush.phpGeneric_Page_Dashboard_View.cssGeneric_Plugin.phpGeneric_Plugin_Admin.phpGeneric_WidgetCommunity_View.phpGeneric_WidgetServices.phpGeneric_WidgetServices_View.phpLicensing_Plugin_Admin.phpMinify_Plugin.phpMinify_Plugin_Admin.phpMobile_Base.phpObjectCache_Environment.phpObjectCache_Page.phpObjectCache_Plugin.phpObjectCache_Plugin_Admin.phpObjectCache_WpObjectCache.phpObjectCache_WpObjectCache_Regular.phpPageSpeed_Api.phpPageSpeed_Instructions.phpPageSpeed_Page.phpPageSpeed_Page_View.cssPageSpeed_Page_View.jsPageSpeed_Widget.phpPgCache_ContentGrabber.phpPgCache_Plugin.phpRoot_AdminMenu.phpRoot_Loader.phpSetupGuide_Plugin_Admin.phpSupport_Page.phpSupport_Page_View_DoneContent.phpSystemOpCache_GeneralPage_View.phpUsageStatistics_GeneralPage_View.phpUsageStatistics_Page.phpUsageStatistics_Page_View_Free.phpUsageStatistics_Widget_View_Disabled.phpUserExperience_DeferScripts_Extension.phpUserExperience_DeferScripts_Mutator.phpUserExperience_DeferScripts_Page_View.phpUserExperience_DeferScripts_Script.jsUserExperience_GeneralPage_View.phpUserExperience_LazyLoad_Page_View.phpUserExperience_Page_View.phpUserExperience_Plugin_Admin.phpUtil_Admin.phpUtil_AttachToActions.phpUtil_Environment.phpUtil_PageSpeed.phpUtil_PageUrls.phpUtil_Ui.phpVarnish_Plugin.php
extension-example
inc
languages
pub
readme.txt
vendor
autoload.php
composer
guzzlehttp
guzzle
psr7
w3-total-cache-api.phpw3-total-cache.php
wp-content
wp-piwik
LICENSEREADME.mdbitcoin.png
classes
config.php
css
gpl-3.0.htmlindex.php
js
languages
proxy
readme.txtscreenshot-1.gifscreenshot-2.gifscreenshot-3.gifscreenshot-4.gifscreenshot-5.gifuninstall.php
update
wp-piwik.phpwpml-config.xml
wp-webauthn
LICENSE
blocks
css
js
languages
readme.txt
vendor
autoload.php
beberlei
brick
composer
fgrosse
league
nyholm
php-http
psr
ramsey
collection
uuid
LICENSEREADME.mdcomposer.json
src
BinaryUtils.php
Builder
Codec
Converter
DegradedUuid.phpDeprecatedUuidInterface.phpDeprecatedUuidMethodsTrait.php
Exception
FeatureSet.php
Fields
Generator
Guid
Lazy
Math
Nonstandard
Provider
Rfc4122
Type
Uuid.phpUuidFactory.phpUuidFactoryInterface.phpUuidInterface.php
Validator
functions.php
spomky-labs
symfony
thecodingmachine
safe
LICENSEREADME.mdcomposer.json
deprecated
generated
Exceptions
apache.phpapcu.phparray.phpbzip2.phpcalendar.phpclassobj.phpcom.phpcubrid.phpcurl.phpdatetime.phpdir.phpeio.phperrorfunc.phpexec.phpfileinfo.phpfilesystem.phpfilter.phpfpm.phpftp.phpfunchand.phpfunctionsList.phpgmp.phpgnupg.phphash.phpibase.phpibmDb2.phpiconv.phpimage.phpimap.phpinfo.phpingres-ii.phpinotify.phpjson.phpldap.phplibxml.phplzf.phpmailparse.phpmbstring.phpmisc.phpmsql.phpmysql.phpmysqli.phpmysqlndMs.phpmysqlndQc.phpnetwork.phpoci8.phpopcache.phpopenssl.phpoutcontrol.phppassword.phppcntl.phppcre.phppdf.phppgsql.phpposix.phpps.phppspell.phpreadline.phprpminfo.phprrd.phpsem.phpsession.phpshmop.phpsimplexml.phpsockets.phpsodium.phpsolr.phpspl.phpsqlsrv.phpssdeep.phpssh2.phpstream.phpstrings.phpswoole.phpuodbc.phpuopz.phpurl.phpvar.phpxdiff.phpxml.phpxmlrpc.phpyaml.phpyaz.phpzip.phpzlib.php
lib
rector-migrate-0.7.php
web-auth
cose-lib
metadata-service
webauthn-lib
LICENSEcomposer.json
src
AttestationStatement
AttestedCredentialData.php
AuthenticationExtensions
AuthenticatorAssertionResponse.phpAuthenticatorAssertionResponseValidator.phpAuthenticatorAttestationResponse.phpAuthenticatorAttestationResponseValidator.phpAuthenticatorData.phpAuthenticatorResponse.phpAuthenticatorSelectionCriteria.php
CertificateChainChecker
CertificateToolbox.phpCollectedClientData.php
Counter
Credential.phpPublicKeyCredential.phpPublicKeyCredentialCreationOptions.phpPublicKeyCredentialDescriptor.phpPublicKeyCredentialDescriptorCollection.phpPublicKeyCredentialEntity.phpPublicKeyCredentialLoader.phpPublicKeyCredentialOptions.phpPublicKeyCredentialParameters.phpPublicKeyCredentialRequestOptions.phpPublicKeyCredentialRpEntity.phpPublicKeyCredentialSource.phpPublicKeyCredentialSourceRepository.phpPublicKeyCredentialUserEntity.phpServer.phpStringStream.php
TokenBinding
TrustPath
U2FPublicKey.php
Util
web-token
jwt-core
jwt-key-mgmt
jwt-signature-algorithm-ecdsa
jwt-signature-algorithm-eddsa
jwt-signature-algorithm-rsa
jwt-signature
wp-webauthn.phpwwa-admin-content.phpwwa-ajax.phpwwa-compatibility.phpwwa-functions.phpwwa-menus.phpwwa-profile-content.phpwwa-shortcodes.phpwwa-version.php

@ -1,329 +0,0 @@
<?php
// No direct access, please
if ( ! defined( 'ABSPATH' ) ) exit;
include_once( 'metaboxes/metabox-functions.php' );
if ( ! function_exists( 'generate_sections_page_template' ) ) {
add_filter( 'template_include', 'generate_sections_page_template' );
/**
* Use our custom template if sections are enabled
*/
function generate_sections_page_template( $template ) {
global $post;
$use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : '';
if ( is_home() || is_archive() || is_search() || is_attachment() || is_tax() ) {
return $template;
}
if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) {
$new_template = dirname( __FILE__ ) . '/templates/template.php';
if ( '' != $new_template ) {
return $new_template;
}
}
return $template;
}
}
if ( ! function_exists( 'generate_sections_show_excerpt' ) ) {
add_filter( 'generate_show_excerpt', 'generate_sections_show_excerpt' );
/**
* If Sections is enabled on a post, make sure we use the excerpt field on the blog page
*/
function generate_sections_show_excerpt( $show_excerpt ) {
global $post;
$use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : '';
if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) {
return true;
}
return $show_excerpt;
}
}
if ( ! function_exists( 'generate_sections_styles' ) ) {
add_action( 'wp_enqueue_scripts', 'generate_sections_styles' );
/**
* Enqueue necessary scripts if sections are enabled
*/
function generate_sections_styles() {
global $post;
$use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : '';
// Bail if we're on a posts page
if ( is_home() || is_archive() || is_search() || is_attachment() || is_tax() ) {
return;
}
if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) {
wp_enqueue_style( 'generate-sections-styles', plugin_dir_url( __FILE__ ) . 'css/style.min.css' );
wp_enqueue_script( 'generate-sections-parallax', plugin_dir_url( __FILE__ ) . 'js/parallax.min.js', array(), GENERATE_SECTIONS_VERSION, true );
}
}
}
if ( ! function_exists( 'generate_sections_body_classes' ) ) {
add_filter( 'body_class', 'generate_sections_body_classes' );
/**
* Add classes to our <body> element when sections are enabled
*/
function generate_sections_body_classes( $classes ) {
global $post;
$use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : '';
$sidebars = apply_filters( 'generate_sections_sidebars', false );
// Bail if we're on a posts page
if ( is_home() || is_archive() || is_search() || is_attachment() || is_tax() ) {
return $classes;
}
if ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) {
$classes[] = 'generate-sections-enabled';
}
if ( ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) && ! $sidebars ) {
$classes[] = 'sections-no-sidebars';
}
if ( ( isset( $use_sections['use_sections'] ) && 'true' == $use_sections['use_sections'] ) && $sidebars ) {
$classes[] = 'sections-sidebars';
}
return $classes;
}
}
if ( ! function_exists( 'generate_sections_add_css' ) ) {
add_action( 'wp_enqueue_scripts', 'generate_sections_add_css', 500 );
/**
* Create the CSS for our sections
*/
function generate_sections_add_css() {
global $post;
$use_sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_use_sections', TRUE) : '';
if ( ! isset( $use_sections['use_sections'] ) ) {
return;
}
if ( 'true' !== $use_sections['use_sections'] ) {
return;
}
if ( is_home() || is_archive() || is_search() || is_attachment() || is_tax() ) {
return;
}
if ( function_exists( 'generate_spacing_get_defaults' ) ) {
$spacing_settings = wp_parse_args(
get_option( 'generate_spacing_settings', array() ),
generate_spacing_get_defaults()
);
$left_padding = $spacing_settings['content_left'];
$right_padding = $spacing_settings['content_right'];
$mobile_padding_left = ( isset( $spacing_settings[ 'mobile_content_left' ] ) ) ? $spacing_settings[ 'mobile_content_left' ] : 30;
$mobile_padding_right = ( isset( $spacing_settings[ 'mobile_content_right' ] ) ) ? $spacing_settings[ 'mobile_content_right' ] : 30;
} else {
$right_padding = 40;
$left_padding = 40;
$mobile_padding = 30;
}
$sections = ( isset( $post ) ) ? get_post_meta( $post->ID, '_generate_sections', TRUE) : '';
// check if the repeater field has rows of data
if ( $sections && '' !== $sections ) {
$css = '.generate-sections-inside-container {padding-left:' . $left_padding . 'px;padding-right:' . $right_padding . 'px;}';
// loop through the rows of data
$i = 0;
foreach ( $sections['sections'] as $section ) :
$i++;
// Get image details
$image_id = ( isset( $section['background_image'] ) && '' !== $section['background_image'] ) ? intval( $section['background_image'] ) : '';
$image_url = ( '' !== $image_id ) ? wp_get_attachment_image_src( $image_id, 'full' ) : '';
// Get the padding type
$padding_type = apply_filters( 'generate_sections_padding_type','px' );
// If someone has changed the padding type using a filter, use their value
if ( 'px' !== $padding_type ) {
$top_padding_type = $padding_type;
$bottom_padding_type = $padding_type;
} else {
$top_padding_type = ( isset( $section['top_padding_unit'] ) && '' !== $section['top_padding_unit'] ) ? $section['top_padding_unit'] : $padding_type;
$bottom_padding_type = ( isset( $section['bottom_padding_unit'] ) && '' !== $section['bottom_padding_unit'] ) ? $section['bottom_padding_unit'] : $padding_type;
}
// Default padding top
$padding_top = apply_filters( 'generate_sections_default_padding_top','40' );
// Default padding bottom
$padding_bottom = apply_filters( 'generate_sections_default_padding_bottom','40' );
$custom_id = ( isset( $section['custom_id'] ) ) ? $section['custom_id'] : '';
$custom_id = ( '' == $custom_id ) ? "generate-section-$i" : $custom_id;
// Get the values
$background_color = ( isset( $section['background_color'] ) && '' !== $section['background_color'] ) ? 'background-color:' . esc_attr( $section['background_color'] ) . ';' : '';
$background_image = ( ! empty( $image_url[0] ) ) ? 'background-image:url(' . esc_url( $image_url[0] ) . ');' : '';
if ( isset( $section['background_color_overlay'] ) && '' !== $section['background_color_overlay'] ) {
if ( '' !== $background_image && '' !== $background_color ) {
$background_image = 'background-image:linear-gradient(0deg, ' . $section['background_color'] . ',' . $section['background_color'] . '), url(' . esc_url( $image_url[0] ) . ');';
$background_color = '';
}
}
$text_color = ( isset( $section['text_color'] ) && '' !== $section['text_color'] ) ? 'color:' . esc_attr( $section['text_color'] ) . ';' : '';
$link_color = ( isset( $section['link_color'] ) && '' !== $section['link_color'] ) ? 'color:' . esc_attr( $section['link_color'] ) . ';' : '';
$link_color_hover = ( isset( $section['link_color_hover'] ) && '' !== $section['link_color_hover'] ) ? 'color:' . esc_attr( $section['link_color_hover'] ) . ';' : '';
$top_padding = ( isset( $section['top_padding'] ) && '' !== $section['top_padding'] ) ? 'padding-top:' . absint( $section['top_padding'] ) . $top_padding_type . ';' : 'padding-top:' . $padding_top . 'px;';
$bottom_padding = ( isset( $section['bottom_padding'] ) && '' !== $section['bottom_padding'] ) ? 'padding-bottom:' . absint( $section['bottom_padding'] ) . $bottom_padding_type . ';' : 'padding-bottom:' . $padding_bottom . 'px;';
// Outer container
if ( '' !== $background_color || '' !== $background_image ) {
$css .= '#' . $custom_id . '.generate-sections-container{' . $background_color . $background_image . '}';
}
// Inner container
if ( '' !== $top_padding || '' !== $bottom_padding || '' !== $text_color ) {
$css .= '#' . $custom_id . ' .generate-sections-inside-container{' . $top_padding . $bottom_padding . $text_color . '}';
}
// Link color
if ( '' !== $link_color ) {
$css .= '#' . $custom_id . ' a,#generate-section-' . $i . ' a:visited{' . $link_color . '}';
}
// Link color hover
if ( '' !== $link_color_hover ) {
$css .= '#' . $custom_id . ' a:hover{' . $link_color_hover . '}';
}
$mobile = generate_premium_get_media_query( 'mobile' );
$css .= '@media ' . esc_attr( $mobile ) . ' {.generate-sections-inside-container {padding-left: ' . $mobile_padding_left . 'px;padding-right: ' . $mobile_padding_right . 'px;}}';
endforeach;
// Build CSS
wp_add_inline_style( 'generate-style', $css );
}
}
}
if ( ! function_exists( 'generate_sections_filter_admin_init' ) ) {
add_action( 'admin_init', 'generate_sections_filter_admin_init' );
/*
* Recreate the default filters on the_content
* this will make it much easier to output the meta content with proper/expected formatting
*/
function generate_sections_filter_admin_init() {
if ( user_can_richedit() ) {
add_filter( 'generate_section_content', 'convert_smilies' );
add_filter( 'generate_section_content', 'convert_chars' );
add_filter( 'generate_section_content', 'wpautop' );
add_filter( 'generate_section_content', 'shortcode_unautop' );
add_filter( 'generate_section_content', 'prepend_attachment' );
}
}
}
if ( ! function_exists( 'generate_sections_filter' ) ) {
add_action( 'init', 'generate_sections_filter' );
/*
* Recreate the default filters on the_content
* this will make it much easier to output the meta content with proper/expected formatting
*/
function generate_sections_filter() {
if ( is_admin() ) {
return;
}
add_filter( 'generate_section_content', 'convert_smilies' );
add_filter( 'generate_section_content', 'convert_chars' );
add_filter( 'generate_section_content', 'wpautop' );
add_filter( 'generate_section_content', 'shortcode_unautop' );
add_filter( 'generate_section_content', 'prepend_attachment' );
add_filter( 'generate_section_content', 'do_shortcode');
add_filter( 'generate_the_section_content', array($GLOBALS['wp_embed'], 'autoembed'), 9 );
}
}
if ( ! function_exists( 'generate_sections_save_content' ) ) {
add_action( 'save_post', 'generate_sections_save_content', 99, 4 );
/*
* When we save our post, grab all of the section content and save it as regular content.
*
* This will prevent content loss/theme lock.
*/
function generate_sections_save_content( $post_id, $post ) {
if ( ! isset( $_POST['_generate_sections_nonce'] ) || ! wp_verify_nonce( $_POST['_generate_sections_nonce'], 'generate_sections_nonce' ) ) {
return;
}
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) {
return;
}
if ( ! current_user_can('edit_post', $post_id ) ) {
return;
}
// See if we're using sections
$use_sections = get_post_meta( $post_id, '_generate_use_sections', true);
// Make sure use sections exists and that we're not saving a revision
if ( ! isset( $use_sections['use_sections'] ) || wp_is_post_revision( $post_id ) ) {
return;
}
// Return if sections are set to false
if ( 'true' !== $use_sections['use_sections'] ) {
return;
}
// Get our sections
$sections = get_post_meta( $post_id, '_generate_sections', true );
// Return if there's nothing in our sections
if ( ! isset( $sections ) || '' == $sections ) {
return;
}
// Prevent infinite loop
remove_action( 'save_post', 'generate_sections_save_content', 99, 4 );
// Let's do some stuff if sections aren't empty
if ( '' !== $sections ) {
// Set up our content variable
$content = '';
// Loop through each section and add our content to the content variable
foreach ( $sections['sections'] as $section ) {
$content .= ( isset( $section['content'] ) && '' !== $section['content'] ) ? $section['content'] . "\n\n" : '';
}
// Now update our post if we have section content
if ( '' !== $content ) {
$post->post_content = $content;
wp_update_post( $post, true );
}
}
// Re-hook the save_post action
add_action('save_post', 'generate_sections_save_content', 99, 4);
}
}