Skip to content

Instantly share code, notes, and snippets.

View bueltge's full-sized avatar
Always interested

Frank Bültge bueltge

Always interested
View GitHub Profile
@bueltge
bueltge / wpse70627-post-format-permalink.php
Created November 5, 2012 13:29
WordPress SE 70627: Post Format Permalink
<?php
/**
* Plugin Name: WPSE70627 Post Format Permalink
* Description: Allow to use Post Format as Permalink; inlcude %post_format% in custom permalink
*/
! defined( 'ABSPATH' ) and exit;
add_filter( 'post_link', 'post_format_permalink', 10, 2 );
add_filter( 'post_type_link', 'post_format_permalink', 10, 2 );
@bueltge
bueltge / gist:4081291
Created November 15, 2012 21:09
WordPress SSL
## .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</IfModule>
## wp-config.php
define( 'FORCE_SSL_LOGIN', TRUE );
define( 'FORCE_SSL_ADMIN', TRUE );
@bueltge
bueltge / attachment-taxononimies.php
Created December 6, 2012 11:38
WordPress Attachment Taxonomies with WP 3.5*
<?php
/**
* Plugin Name: Attachment Taxonomies
* Plugin URI: attachment_taxonomies
* Text Domain: addquicktag
* Domain Path: /languages
* Description:
* Version: 1.0.0
* Author: Frank Bültge
* Author URI: http://bueltge.de
@bueltge
bueltge / keep_me_logged_in_for_1_year.php
Last active January 4, 2023 10:39
WordPress Plugin, that set the time that the cookie will be kept at 1 year and active the 'Rember Me' Checkbox for default
<?php
/**
* Plugin Name: Keep me Logged In for 1 Year
* Plugin URI: https://bueltge.de/wordpress-login-unterbinden/1220/
* Description: Set the time that the cookie will be kept at 1 year.
* Version: 0.0.3
* Author: Frank Bültge
* Author URI: https://bueltge.de/
*/
@bueltge
bueltge / rem-fallback.scss
Created January 2, 2013 15:31
Fallback rem-mixin Sass, Compass
$main-font-size: 16px;
@mixin x-rem ($property, $value) {
#{$property}: $value * $main-font-size;
#{$property}: #{$value}rem;
}
.some-class {
@include x-rem(font-size, 1.4);
@bueltge
bueltge / fb_deactivate_oembed.php
Created January 2, 2013 20:30
Deactivate oembed in WordPress 3.5 and earlier
<?php
/**
* Plugin Name: Deactivate oEmbed
* Description: Deactivate oEmbed in WordPress 3.5 and earlier
* Version: 0.0.1
* Author: Frank Bültge
* Author URI: http://bueltge.de/
*/
remove_filter( 'the_content', array( $GLOBALS['wp_embed'], 'autoembed' ), 8 );
@bueltge
bueltge / fb_allow_iframe_tinymce.php
Created January 11, 2013 15:52
Wordpress plugin for allow iframe in the visual Editor
<?php
/**
* Plugin Name: iFrame for TinyMCE
* Description: Allow iframe in the visual Editor
* Version: 0.0.1
* Author: Frank Bültge
* Author URI: http://bueltge.de/
*/
! defined( 'ABSPATH' ) and exit;
<?php
/**
* Plugin Name: Adsense after more-Tag
* Description: Add content of var $extra_more after more-Tag
* Version: 0.0.1
* Author: Frank Bültge
* Author URI: http://bueltge.de/
*/
! defined( 'ABSPATH' ) and exit;
// path/to/theme/tinymce/en.js
// plugin.jsと同じディレクトリに設置
tinyMCE.addI18n("en.test_plugin",{
test_listbox : "Test listbox",
test_button : "Test button",
});
@bueltge
bueltge / example.php
Last active June 15, 2017 05:39
Example to use the taxonomie Dropdown for Customizer, the classes are inside the project: https://github.com/bueltge/Wordpress-Theme-Customizer-Custom-Controls
<?php
/**
* @see: https://github.com/bueltge/Wordpress-Theme-Customizer-Custom-Controls
*/
add_action( 'customize_register', 'fb_customize_register' );
function fb_customize_register( $wp_customize ) {
require_once( 'class-taxonomy_dropdown_custom_control.php' );
$wp_customize->add_section(