. */ class TCPPaginaHome { function __construct() { add_action( 'admin_menu', array( &$this, 'admin_menu' ), 50 ); } function admin_menu() { $page = add_theme_page( __( 'Bootstrap eCommerce Shortcuts, 3 Cols', 'tcp-bootstrap-ecommerce' ), __( 'Shortcuts, 3 Cols', 'tcp-bootstrap-ecommerce' ), 'tcp_edit_products', 'pagina_home_settings', array( &$this, 'admin_page' ) ); add_action( "load-$page", array( &$this, 'admin_action' ) ); } function admin_page() { ?>

updated ) ) : ?>

/>

<?php echo $url; ?>

<?php echo $url; ?>

<?php echo $url; ?>
update_file( 'tcp_rs_image_a' ); $this->update_file( 'tcp_rs_image_b' ); $this->update_file( 'tcp_rs_image_c' ); $this->updated = true; } elseif ( isset( $_REQUEST['save-pagina_home-remove_image_a'] ) ) { $this->remove_file( 'tcp_rs_image_a' ); } elseif ( isset( $_REQUEST['save-pagina_home-remove_image_b'] ) ) { $this->remove_file( 'tcp_rs_image_b' ); } elseif ( isset( $_REQUEST['save-pagina_home-remove_image_c'] ) ) { $this->remove_file( 'tcp_rs_image_c' ); } } function update_file( $id ) { if ( isset( $_FILES[$id] ) && $_FILES[$id]['name'] !== '' ) { $this->remove_file( $id ); $file = $_FILES[$id]; if ( ! function_exists( 'wp_handle_upload' ) ) require_once( ABSPATH . 'wp-admin/includes/file.php' ); $upload_overrides = array( 'test_form' => false ); $movefile = wp_handle_upload( $file, $upload_overrides ); update_option( $id, $movefile ); } } private function remove_file( $id ) { $path_to_delete = get_option( $id, false ); if ( $path_to_delete !== false ) unlink( $path_to_delete['file'] ); delete_option( $id ); } } new TCPPaginaHome(); add_shortcode( '3boxes', 'tcp_get_the_three_boxes' ); function tcp_get_the_three_boxes() { return tcp_the_three_boxes( false ); } function tcp_the_three_boxes( $echo = true ) { ob_start(); ?>