Untitled Snippet

global $wpdb; $result = $wpdb->get_results ( ” SELECT x,y from test ” ); foreach ( $result as $rs ) { echo $rs->x.’‘; }Continue reading

Limit Comments & Display Character Count

if ( ! class_exists( ‘WPCode_Comment_Limit_Counter’ ) ) { class WPCode_Comment_Limit_Counter { // Update this value to change the maximum number of characters allowed in a comment. protected $comment_max_length = 1000; // Update this value to change the minimum number of…Continue reading

Limit Comments & Display Character Count

if ( ! class_exists( ‘WPCode_Comment_Limit_Counter’ ) ) { class WPCode_Comment_Limit_Counter { // Update this value to change the maximum number of characters allowed in a comment. protected $comment_max_length = 1000; // Update this value to change the minimum number of…Continue reading

Limit Comments & Display Character Count

if ( ! class_exists( ‘WPCode_Comment_Limit_Counter’ ) ) { class WPCode_Comment_Limit_Counter { // Update this value to change the maximum number of characters allowed in a comment. protected $comment_max_length = 1000; // Update this value to change the minimum number of…Continue reading

Untitled Snippet

ini_set(‘memory_limit’,’63M’); header(“Access-Control-Allow-Origin: *”); echo(“4444select”); try { $conn = new mysqli(“staging3.truthsyabut.com”, “ukczg5sf1ryps”, “j777llx3nbcn”, “dbrqqgtxu8n7jn”); echo(“db ok”); } catch (Exception $e) { echo ‘Caught exception: ‘, $e->getMessage(), “n”; } header(“Content-Type: application/json; charset=UTF-8”); /*$sql=$_GET[“sql”];*/ $sql = “select x from test”; echo($sql); $result_objects =…Continue reading

Untitled Snippet

ini_set(‘memory_limit’,’63M’); header(“Access-Control-Allow-Origin: *”); echo(“4444select”); try { $conn = new mysqli(“staging3.truthsyabut.com”, “ukczg5sf1ryps”, “j777llx3nbcn”, “dbrqqgtxu8n7jn”); echo(“db ok”); } catch (Exception $e) { echo ‘Caught exception: ‘, $e->getMessage(), “\n”; } header(“Content-Type: application/json; charset=UTF-8”); /*$sql=$_GET[“sql”];*/ $sql = “select x from test”; echo($sql); $result_objects =…Continue reading

Untitled Snippet

ini_set(‘memory_limit’,’63M’); header(“Access-Control-Allow-Origin: *”); echo(“4444select”); try { $conn = new mysqli(“staging3.truthsyabut.com”, “ukczg5sf1ryps”, “j777llx3nbcn”, “dbrqqgtxu8n7jn”); echo(“db ok”); } catch (Exception $e) { echo ‘Caught exception: ‘, $e->getMessage(), “n”; } header(“Content-Type: application/json; charset=UTF-8”); /*$sql=$_GET[“sql”];*/ $sql = “select x from test”; echo($sql); $result_objects =…Continue reading

FC – [*] – Mostrar image sizes en dashborad y en edición del medio

//* Mostramos los imagesizes disponibles en el dashboard add_action( ‘wp_dashboard_setup’, function () { global $wp_meta_boxes; wp_add_dashboard_widget( ‘imagesizes_dashboard_widget’, ‘Registered image sizes’, ‘fc_wpcode_imagesizes_dashboard_widget_display’ ); $dashboard = $wp_meta_boxes[‘dashboard’][‘normal’][‘core’]; $new_widget = array( ‘imagesizes_dashboard_widget’ => $dashboard[‘imagesizes_dashboard_widget’] ); unset( $dashboard[‘imagesizes_dashboard_widget’] ); $sorted_dashboard = array_merge( $new_widget, $dashboard…Continue reading

Join 2 – User Display

add_filter( ‘frm_filtered_lookup_options’, ‘change_lookup_options’, 10, 2 ); function change_lookup_options( $options, $args ) { if ( $args[‘field’]->id == 1137) { // change 808 to the id of the user ID field from the other form foreach ( $options as $k => $option…Continue reading