This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Force update our username (user_login) | |
global $wpdb; | |
$tablename = $wpdb->prefix . "users"; | |
// method 1 | |
//$sql = $wpdb->prepare("UPDATE %s SET user_login=%s WHERE ID=%d", $tablename, $user_email, $user_id); | |
//$wpdb->query($sql); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function in_array_r($needle, $haystack) { | |
$found = false; | |
foreach ($haystack as $item) { | |
if ($item === $needle) { | |
$found = true; | |
break; | |
} elseif (is_array($item)) { | |
$found = in_array_r($needle, $item); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>Sed consequat <a href="#">dapibus mauris vitae sagittis</a>. Phasellus pellentesque <b>magna commodo</b> purus dictum euismod. <em>Vivamus ac orci vel purus</em> lobortis faucibus. <strong>Nullam porttitor</strong> tincidunt sodales. Nullam in orci sit amet purus euismod gravida nec <i>at metus</i>. Proin sit amet lorem lectus, convallis ornare massa.</p> | |
<ins>In at sodales nisl. In lacus libero, egestas eget venenatis vitae, posuere porttitor elit.</ins> | |
<p>Quisque laoreet <code>auctor felis</code> at congue. Ut nisl eros, <abbr title="abbr">dignissim</abbr> eget auctor non, mattis vitae dolor. Donec posuere <kbd>massa</kbd> eu dolor commodo luctus. In at sodales nisl. In lacus libero, egestas eget venenatis vitae, posuere porttitor elit. <dfn>Vivamus vel tristique magna</dfn>. Morbi non elit ante, sed venenatis diam. Vivamus vehicula orci sed quam aliquet sagittis. Quisque auctor placerat pharetra.</p> | |
<pre> | |
p { | |
font-size:1em; | |
<mark>margin-bottom: 1.5em;</mark> | |
} | |
</pre> | |
<h2>Vivamus vel tristique magna. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function fublo_gf_profile_update( $entry, $form ) | |
{ | |
// make sure that the user is logged in | |
// we shouldn't get here because the form should check for logged in users... | |
if ( !is_user_logged_in() ) | |
{ | |
wp_redirect( home_url() ); | |
exit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a[alt]:before { | |
content: ""; | |
display: block; | |
width: 500px; | |
height: 252px; | |
background-image: url('http://bukk.it/curses.gif'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// no idea why this works but add to wp-config.php | |
define('SCRIPT_DEBUG', true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*----------------------------------------------------------------------------------------*/ | |
/* Opt-in typography - http://goo.gl/H6sGd | |
* Zero off common semantic elements to stop re-definition | |
* Use .text class on the parent of anything requiring text styles | |
/*----------------------------------------------------------------------------------------*/ | |
$baseline: 1.5em; | |
@mixin zero-text-elements { | |
h1, h2, h3, h4, h5, h6, blockquote, pre, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Return link by post ID | |
// ------------------------------------------------------------- | |
function link_by_id($post_id) { | |
echo '<a href="'.get_permalink($post_id).'">'.get_the_title($post_id).'</a>'; | |
} | |
// Return the root parent ID | |
// ------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// EVENTS | |
add_action('init', '_init_event_post_type'); | |
function _init_event_post_type() { | |
// Create taxonomy | |
register_taxonomy( | |
'event_category', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// include template using WP shortcode | |
function my_shortcode_include() { | |
ob_start(); | |
// include your template e.g. /inc/random-panel.php | |
get_template_part('inc/random-panel'); | |
$output_string = ob_get_contents(); | |
ob_end_clean(); | |
return $output_string; |