.grow { transition: all .2s ease-in-out; } .grow:hover { transform: scale(1.1); }
Author Archives: Wojciech Borowicz
$content = get_post()->post_content; echo $content = apply_filters(‘the_content’, $content);
add_action(‘admin_head’, ‘hide_updates’); function hide_updates() { if(get_current_user_id()!=1){ echo ‘<style> span.update-plugins{display:none!important;} tr.plugin-update-tr.active {display:none!important} .wrap .notice.notice-error { display: none!important;} </style>’; } }
function wpdocs_register_meta_boxes() { add_meta_box( ‘meta-box-id’, __( ‘Backend Name’, ‘textdomain’ ), ‘wpdocs_my_display_callback’, ‘post_type’ ); } add_action( ‘add_meta_boxes’, ‘wpdocs_register_meta_boxes’ ); function wpdocs_my_display_callback( $post ) { // INPUT FIELDS GO HERE ?> <label>Year: <input type=”text” name=”inputName” value=”<?php echo get_post_meta(get_the_ID(), ‘meta_key’)[0]; ?>” /></label> <?php } /** * Save meta box content. * * @param int $post_id Post ID */ […]
p.pulsating { font-size: 13px; color: #bf5b5b; -webkit-animation: pulsate 3s ease-out; -webkit-animation-iteration-count: infinite; opacity: 0.5; } @-webkit-keyframes pulsate { 0% { opacity: 0.5; } 50% { opacity: 1.0; font-size:13.5px; } 100% { opacity: 0.5; } }
$query = mysqli_query($mySQLiConnection, “SELECT * FROM table WHERE 1=1”); $array = array(); // look through query while($row = mysqli_fetch_assoc($query)){ // add each row returned into an array $array[] = $row; // OR just echo the data: echo $row[‘username’]; // etc } print_r($array);
$link = mysqli_connect($db_host, $username, $password, $database); if (!$link) { echo “Error: Unable to connect to MySQL.” . PHP_EOL; echo “Debugging errno: ” . mysqli_connect_errno() . PHP_EOL; echo “Debugging error: ” . mysqli_connect_error() . PHP_EOL; exit; } echo “Success: A proper connection to MySQL was made! The my_db database is great.” . PHP_EOL; echo “Host information: […]
/** * Display field value on the order edit page */ add_action( ‘woocommerce_admin_order_data_after_billing_address’, ‘my_custom_checkout_field_display_admin_order_meta’, 10, 1 ); function my_custom_checkout_field_display_admin_order_meta($order){ echo ‘This line will appear at the end of order details box’; }
function add_backend_panel(){ add_menu_page(‘Name’, ‘Label, ‘edit_dashboard’, ‘attendees-list’, ‘ContentFunction’, ‘dashicons-list-view’); } add_action(‘admin_menu’, ‘add_backend_panel’); // function to display created page content function ContentFunction(){ echo ‘Content goes here.’; }
add_action(‘woocommerce_before_cart_table’, ‘automatic_copons’); function automatic_coupons() { global $woocommerce; if( current_user_can(‘administrator’) || current_user_can(‘staff’) || current_user_can(‘editor’)) { $woocommerce->cart->add_discount(‘FreeShipping’); } }