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
function add_users_to_bpgroup() { | |
$group_id = 1; | |
$users = get_users(); // all users | |
foreach ( $users as $user ) { | |
var_dump(groups_join_group($group_id, $user->ID )); | |
} | |
} | |
add_action ( 'wp_enqueue_scripts', 'add_users_to_bpgroup' ); |
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
function on_save( $post_id ) { | |
$post_type = get_post_type($post_id); | |
// order page | |
if ($post_type == 'shop_order'){} | |
} | |
add_action( 'save_post', 'ag_on_booking_save' ); // called after post saved |
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
$dump = print_r( $_POST, true ); | |
file_put_contents('test.txt', $dump ); |
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
<div class='image'> | |
<img src='src/image.png'> | |
</div> | |
.image{ | |
display: table-cell; | |
vertical-align: middle; | |
height: 320px; | |
} |
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
git log | |
git reset --soft HEAD^ | |
git status |
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
$all_plugins = get_option(); | |
$active_plugins = get_option('active_plugins'); | |
foreach ($active_plugins as $plugin){ | |
if (is_plugin_active_for_network($plugin)){ | |
// plugin is network activated | |
} | |
} |
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
$posts = get_posts(array( | |
'post_type' => $post_type, | |
'posts_per_page' => -1, | |
'post_status' => 'publish' | |
)); | |
foreach ($posts as $post){ | |
$post->post_status = 'draft'; |
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
_element.stop().animate({scrollTop: _offset}, 600) |
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
# conversion factor | |
private $conv_fac = 0.621371; | |
// convert miles to kilometers | |
private function miles_to_kl($miles) { | |
return $miles / $this->conv_fac; | |
} | |
// convert kilometers to miles | |
private function kl_to_miles($kilometers) { |
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
4GiB SODIMM DDR3 Synchronous 1600 MHz | |
Memory Device | |
Array Handle: 0x0023 | |
Error Information Handle: 0x0026 | |
Total Width: 64 bits | |
Data Width: 64 bits | |
Size: 4096 MB | |
Form Factor: SODIMM | |
Set: None |
OlderNewer