Skip to content

Instantly share code, notes, and snippets.

add_action('current_screen', "whats_my_hook" );
function whats_my_hook() {
global $page_hook;
echo "My page hook:" . $page_hook;
}
<?php
$file = fopen("dicar.csv","r");
while (($data = fgetcsv($file)) !== FALSE) {
//echo "<pre>";print_r($data);
$split_old_url = explode("?", $data[0]);
$querystring = $split_old_url[1];
$url = $split_old_url[0];
$url = explode('/', $url);
//
// Set extra styles for TINY MCE
// 1. Enable the styles dropdown
add_filter( 'mce_buttons_2', 'my_mce_buttons_2' );
function my_mce_buttons_2( $buttons ) {
array_unshift( $buttons, 'styleselect' );
return $buttons;
}
// 2. Add the correct style
function mens_project_init() {
register_post_type( 'mens_project', array(
'hierarchical' => false,
'public' => true,
'show_in_nav_menus' => true,
'show_ui' => true,
'supports' => array( 'title', 'editor', 'thumbnail' ),
'has_archive' => false,
'query_var' => true,
'rewrite' => array(
//
// Set extra styles for TINY MCE
// 1. Enable the styles dropdown
add_filter( 'mce_buttons_2', 'my_mce_buttons_2' );
function my_mce_buttons_2( $buttons ) {
array_unshift( $buttons, 'styleselect' );
return $buttons;
}
// 2. Add the correct style
module.exports = function(grunt) {
// 1. All configuration goes here
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
sass: {
files: ['*.{scss,sass}'],
tasks: ['sass:dist','postcss:dist']
},
@dendeffe
dendeffe / SilverStripe Image template tags
Created April 27, 2011 10:32
Example of SilverStripe Image template tags
$Image.SetWidth(80) // returns a image 80px wide, ratio kept the same
$Image.SetHeight(80) // returns a image 80px tall, ration kept the same
$Image.SetSize(80,80) // returns a 80x80px padded image
$Image.SetRatioSize(80,80) // **New in 2.4** returns an image scaled proportional, with its greatest diameter scaled to 80px
$Image.PaddedImage(80, 80) // Returns an 80x80 image. Unused space is padded white. No crop. No stretching
$Image.Width // returns width of image
$Image.Height // returns height of image
$Image.Orientation // returns Orientation
$Image.Filename // returns filename
$Image.URL // returns filename
<?php
// Example of how to use a SilverStripe module: https://github.com/dendeffe/Def_MailTools
/****
/ CONFIG
***/
// You can do these config settings in mysite/_config.php
for($x = 0; $x < $total_page_count; $++) {
echo '<a href="#">' . ($x+1) . '</a>';
}
<!-- fout -->
<img src=''mijnafbeelding.jpg'' />
<!-- juist -->
<img src="mijnafbeelding.jpg" />