Commit inicial - WordPress Análisis de Precios Unitarios

- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-03 21:04:30 -06:00
commit a22573bf0b
24068 changed files with 4993111 additions and 0 deletions

View File

@@ -0,0 +1,155 @@
<?php
class OPanda_Elementor_Container_Extention {
public static function init() {
$me = 'OPanda_Elementor_Container_Extention';
add_action( 'elementor/element/column/section_advanced/before_section_start', "$me::section_start");
add_action( 'elementor/element/section/section_advanced/before_section_start', "$me::section_start" );
add_action( 'elementor/frontend/column/before_render', "$me::frontend_before_render" );
add_action( 'elementor/frontend/section/before_render', "$me::frontend_before_render" );
add_action( 'elementor/frontend/column/after_render', "$me::frontend_after_render" );
add_action( 'elementor/frontend/section/after_render', "$me::frontend_after_render" );
}
/**
* Returns available lockers to select.
*/
protected static function get_lockers_options() {
$result = array();
$result['none'] = __('- not select -', 'bizpanda');
$allowed_shortcodes = [];
if ( BizPanda::hasPlugin('sociallocker') ) {
$allowed_shortcodes['sociallocker'] = true;
$allowed_shortcodes['signinlocker'] = true;
}
if ( BizPanda::hasPlugin('optinpanda') ) {
$allowed_shortcodes['emaillocker'] = true;
$allowed_shortcodes['signinlocker'] = true;
}
$allowed_shortcodes = array_keys( $allowed_shortcodes );
$lockers = get_posts(array(
'post_type' => OPANDA_POST_TYPE,
'meta_key' => 'opanda_item',
'meta_value' => OPanda_Items::getAvailableNames(),
'numberposts' => -1
));
foreach($lockers as $locker)
{
$itemType = get_post_meta( $locker->ID, 'opanda_item', true );
$item = OPanda_Items::getItem($itemType);
$shortcode = $item['shortcode'];
if ( !in_array( $shortcode, $allowed_shortcodes)) continue;
$lockerId = $shortcode . '-' . $locker->ID;
$result[$lockerId] = empty( $locker->post_title ) ? '(no titled, ID=' . $locker->ID . ')' : $locker->post_title;
}
return $result;
}
/**
* Adds the locker picker for column and section elements.
*/
public static function section_start( \Elementor\Element_Base $element )
{
if (BizPanda::hasPlugin('sociallocker')) {
$element->start_controls_section(
'section_locker',
[
'label' => __('Social Locker', 'mld'),
'tab' => \Elementor\Controls_Manager::TAB_ADVANCED,
]
);
} elseif ( BizPanda::hasPlugin('optinpanda') ) {
$element->start_controls_section(
'section_spacing',
[
'label' => __( 'Opt-In Panda', 'mld' ),
'tab' => \Elementor\Controls_Manager::TAB_ADVANCED,
]
);
}
$element->add_control(
'opanda_locker_id',
[
'label' => __( 'Locker', 'bizpanda' ),
'type' => \Elementor\Controls_Manager::SELECT,
'options' => self::get_lockers_options(),
'default' => 'none',
'description' => 'A locker to be applied to content of the container.'
]
);
$element->end_controls_section();
}
/**
* Elements that where buffered.
* @var array
*/
protected static $buffered_elements = [];
/**
* Starts buffering before rendering the element to attach the locker shortcode.
* @param \Elementor\Element_Base $element
*/
public static function frontend_before_render( \Elementor\Element_Base $element ) {
$settings = $element->get_settings_for_display();
if ( isset( $settings['opanda_locker_id'] ) && !empty( $settings['opanda_locker_id'] ) ) {
if ( 'none' === $settings['opanda_locker_id'] ) return;
$parts = explode('-', $settings['opanda_locker_id']);
if ( count( $parts ) !== 2 ) return;
$elementId = $element->get_id();
$shortcode = $parts[0];
$lockerId = $parts[1];
self::$buffered_elements[$elementId] = [
'elementId' => $elementId,
'shortcode' => $shortcode,
'lockerId' => $lockerId
];
ob_start();
}
}
/**
* Ends buffering and prints content with the locker.
* @param \Elementor\Element_Base $element
*/
public static function frontend_after_render( \Elementor\Element_Base $element ) {
$elementId = $element->get_id();
if ( !isset( self::$buffered_elements[$elementId] ) ) return;
$shortcode = self::$buffered_elements[$elementId]['shortcode'];
$lockerId = self::$buffered_elements[$elementId]['lockerId'];
$to_lock = ob_get_contents(); ob_end_clean();
echo do_shortcode('[' . $shortcode . ' id="' . $lockerId . '"]'.$to_lock.'[/' . $shortcode . ']');
}
}
OPanda_Elementor_Container_Extention::init();

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1,6 @@
.opanda-social-locker-vc-icon {
background: url(icon-sociallocker-32x32.png) no-repeat 0 0 !important;
}
.opanda-bizpanda-vc-icon {
background: url(icon-bizpanda-32x32.png) no-repeat 0 0 !important;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -0,0 +1,99 @@
<?php
function opanda_register_vc_elements() {
if ( !class_exists("WPBakeryShortCodesContainer") ) return;
class WPBakeryShortCode_sociallocker extends WPBakeryShortCodesContainer {}
class WPBakeryShortCode_emaillocker extends WPBakeryShortCodesContainer {}
class WPBakeryShortCode_signinlocker extends WPBakeryShortCodesContainer {}
$options = array(
"content_element" => true,
"show_settings_on_create" => true,
"as_parent" => array('except' => 'nothing_or_something'),
"params" => array(
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Select locker to insert", "bizpanda"),
"param_name" => "id",
"description" => ""
)
),
"js_view" => 'VcColumnView'
);
if ( BizPanda::hasPlugin('sociallocker') ) {
$options['category'] = BizPanda::isSinglePlugin() ? __('Social Locker', 'bizpanda') : __('BizPanda', 'bizpanda');
$options['icon'] = BizPanda::isSinglePlugin() ? 'opanda-social-locker-vc-icon' : 'opanda-bizpanda-vc-icon';
$options['name'] = __('Social Locker', 'bizpanda');
$options['base'] = 'sociallocker';
$options['description'] = __('Adds one of existing Social Lockers.', 'bizpanda');
$lockers = get_transient('opanda_vc_social_lockers');
if ( false === $lockers ) {
$lockers = opanda_get_lockers('social-locker', 'vc');
set_transient ('opanda_vc_social_lockers', $lockers, 60 * 60 * 24);
}
$options['params'][0]['value'] = $lockers;
vc_map( $options );
}
if ( BizPanda::hasPlugin('optinpanda') ) {
$options['category'] = BizPanda::isSinglePlugin() ? __('Opt-In Panda', 'bizpanda') : __('BizPanda', 'bizpanda');
$options['icon'] = 'opanda-bizpanda-vc-icon';
$options['name'] = __('Email Locker', 'bizpanda');
$options['base'] = 'emaillocker';
$options['description'] = __('Adds one of existing Email Lockers.', 'bizpanda');
$lockers = get_transient('opanda_vc_email_lockers');
if ( false === $lockers ) {
$lockers = opanda_get_lockers('email-locker', 'vc');
set_transient ('opanda_vc_email_lockers', $lockers, 60 * 60 * 24);
}
$options['params'][0]['value'] = $lockers;
vc_map( $options );
}
if ( BizPanda::isSinglePlugin() && BizPanda::hasPlugin('sociallocker') ) {
$options['category'] = __('Social Locker', 'bizpanda');
$options['icon'] = 'opanda-social-locker-vc-icon';
} elseif ( BizPanda::isSinglePlugin() && BizPanda::hasPlugin('optinpanda') ) {
$options['category'] = __('Opt-In Panda', 'bizpanda');
$options['icon'] = 'opanda-bizpanda-vc-icon';
} else {
$options['category'] = __('BizPanda', 'bizpanda');
$options['icon'] = 'opanda-bizpanda-vc-icon';
}
$options['name'] = __('Sign-In Locker', 'bizpanda');
$options['base'] = 'signinlocker';
$options['description'] = __('Adds one of existing Sign-In Lockers.', 'bizpanda');
$lockers = get_transient('opanda_vc_signin_lockers');
if ( false === $lockers ) {
$lockers = opanda_get_lockers('signin-locker', 'vc');
set_transient ('opanda_vc_signin_lockers', $lockers, 60 * 60 * 24);
}
$options['params'][0]['value'] = $lockers;
vc_map( $options );
}
add_action('vc_before_init', 'opanda_register_vc_elements');
function opanda_vc_elements_css( $hook ) {
if ( !class_exists("WPBakeryShortCodesContainer") ) return;
if( $hook !== "post.php" && $hook !== "edit.php" && $hook !== "post-new.php" ) return;
delete_transient('opanda_vc_social_lockers');
delete_transient('opanda_vc_email_lockers');
delete_transient('opanda_vc_signin_lockers');
wp_enqueue_style( 'opdanda-vc-elements-css', OPANDA_BIZPANDA_URL . "/extras/visual-composer/assets/style.css" );
}
add_action('admin_enqueue_scripts', 'opanda_vc_elements_css');