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,81 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Referral;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Category extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'referral_data';
}
/**
* @return string
*/
public static function get_key() {
return 'referral_category_id';
}
public static function get_label() {
return esc_html__( 'Category', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'autocomplete' ];
}
public function get_value( $referral_data ) {
$categories = [];
if ( ! empty( $referral_data['post'] ) ) {
foreach ( get_the_category( $referral_data['post'] ) as $category ) {
$categories[] = $category->term_id;
}
}
return $categories;
}
public static function get_options( $selected_values = [], $searched_keyword = '' ) {
$categories = [];
foreach ( get_categories() as $category ) {
if ( static::filter_options( $category->term_id, $category->name, $selected_values, $searched_keyword ) ) {
$categories[] = [
'value' => (string) $category->term_id,
'label' => $category->name,
];
}
}
return $categories;
}
/**
* @return string
*/
public static function get_placeholder_text() {
return esc_html__( 'Search categories', 'thrive-cb' );
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 20;
}
}

View File

@@ -0,0 +1,58 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Referral;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Domain extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'referral_data';
}
/**
* @return string
*/
public static function get_key() {
return 'referral_domain';
}
public static function get_label() {
return esc_html__( 'Domain', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'string_contains' ];
}
public function get_value( $referral_data ) {
return empty( $referral_data['url'] ) ? '' : parse_url( $referral_data['url'], PHP_URL_HOST );
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 5;
}
/**
* @return string
*/
public static function get_placeholder_text() {
return esc_html__( 'Enter a domain URL', 'thrive-cb' );
}
}

View File

@@ -0,0 +1,49 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Referral;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
if ( ! class_exists( 'Referral_Post', false ) ) {
require_once __DIR__ . '/class-post.php';
}
class Page extends Post {
/**
* @return string
*/
public static function get_key() {
return 'referral_page_id';
}
public static function get_label() {
return esc_html__( 'Page', 'thrive-cb' );
}
public static function get_post_type() {
return 'page';
}
/**
* @return string
*/
public static function get_placeholder_text() {
return esc_html__( 'Search pages', 'thrive-cb' );
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 15;
}
}

View File

@@ -0,0 +1,92 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Referral;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Post extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'referral_data';
}
/**
* @return string
*/
public static function get_key() {
return 'referral_post_id';
}
public static function get_label() {
return esc_html__( 'Post', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'autocomplete' ];
}
public function get_value( $referral_data ) {
return empty( $referral_data['post'] ) ? '' : $referral_data['post']->ID;
}
public static function get_options( $selected_values = [], $searched_keyword = '' ) {
$query = [
'posts_per_page' => empty( $selected_values ) ? min( 100, max( 20, strlen( $searched_keyword ) * 3 ) ) : - 1,
'post_type' => static::get_post_type(),
'orderby' => 'title',
'order' => 'ASC',
];
if ( ! empty( $searched_keyword ) ) {
$query['s'] = $searched_keyword;
}
if ( ! empty( $selected_values ) ) {
$query['include'] = $selected_values;
}
$posts = [];
foreach ( get_posts( $query ) as $post ) {
if ( static::filter_options( $post->ID, $post->post_title, $selected_values, $searched_keyword ) ) {
$posts[] = [
'value' => (string) $post->ID,
'label' => $post->post_title,
];
}
}
return $posts;
}
public static function get_post_type() {
return 'post';
}
/**
* @return string
*/
public static function get_placeholder_text() {
return esc_html__( 'Search posts', 'thrive-cb' );
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 10;
}
}

View File

@@ -0,0 +1,85 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Referral;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Tag extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'referral_data';
}
/**
* @return string
*/
public static function get_key() {
return 'referral_tag_id';
}
public static function get_label() {
return esc_html__( 'Tag', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'autocomplete' ];
}
public function get_value( $referral_data ) {
$tags = [];
if ( ! empty( $referral_data['post'] ) ) {
$post_tags = get_the_tags( $referral_data['post'] );
if ( ! empty( $post_tags ) ) {
foreach ( $post_tags as $tag ) {
$tags[] = $tag->term_id;
}
}
}
return $tags;
}
public static function get_options( $selected_values = [], $searched_keyword = '' ) {
$tags = [];
foreach ( get_tags() as $tag ) {
if ( static::filter_options( $tag->term_id, $tag->name, $selected_values, $searched_keyword ) ) {
$tags[] = [
'value' => (string) $tag->term_id,
'label' => $tag->name,
];
}
}
return $tags;
}
/**
* @return string
*/
public static function get_placeholder_text() {
return esc_html__( 'Search tags', 'thrive-cb' );
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 25;
}
}

View File

@@ -0,0 +1,58 @@
<?php
/**
* Thrive Themes - https://thrivethemes.com
*
* @package thrive-visual-editor
*/
namespace TCB\ConditionalDisplay\Fields\Referral;
use TCB\ConditionalDisplay\Field;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Silence is golden!
}
class Url extends Field {
/**
* @return string
*/
public static function get_entity() {
return 'referral_data';
}
/**
* @return string
*/
public static function get_key() {
return 'referral_url';
}
public static function get_label() {
return esc_html__( 'URL', 'thrive-cb' );
}
public static function get_conditions() {
return [ 'url_comparison' ];
}
public function get_value( $referral_data ) {
return empty( $referral_data['url'] ) ? '' : $referral_data['url'];
}
/**
* Determines the display order in the modal field select
*
* @return int
*/
public static function get_display_order() {
return 0;
}
/**
* @return string
*/
public static function get_placeholder_text() {
return esc_html__( 'Enter a URL. Use an asterisk as a wildcard', 'thrive-cb' );
}
}