Skip to content

Instantly share code, notes, and snippets.

@duogeekdev
duogeekdev / Append post ID at the end of the URL for a custom post type.php
Created May 14, 2015
Append post ID at the end of the URL for a custom post type
View Append post ID at the end of the URL for a custom post type.php
<?php
function change_post_type_link( $link, $post = 0 ){
if ( $post->post_type == 'product' ){
return home_url( 'product/'. $post->post_name .'/'. $post->ID );
} else {
return $link;
}
}
@duogeekdev
duogeekdev / gist:80ced57d29bdd7611ab4
Created May 9, 2015
Disable JavaScript concatenation
View gist:80ced57d29bdd7611ab4
<?php
define( 'CONCATENATE_SCRIPTS', false );
View gist:9ac656dd89c4f0b55dd6
<?php
define ( 'COOKIE_DOMAIN', 'www.domain.com' );
View gist:d76884c1a06f56f14298
<?php
/** Turns the output of errors on or off, you really never want this on, you should only view errors by reading the log file. */
ini_set('display_errors', WP_DEBUG_DISPLAY);
/** Tells whether script error messages should be logged to the server's error log or error_log. */
ini_set('log_errors', 'On');
/** http://us.php.net/manual/en/timezones.php */
ini_set('date.timezone', 'America/Indianapolis');
@duogeekdev
duogeekdev / gist:dad0a55257e9b0da2881
Created May 9, 2015
Custom User / UserMeta Tables
View gist:dad0a55257e9b0da2881
<?php
define( 'CUSTOM_USER_TABLE', $table_prefix . 'custom_users' );
define( 'CUSTOM_USER_META_TABLE', $table_prefix . 'custom_usermeta' );
View gist:be159ea4c60bac7a2164
<?php
define( 'WP_MEMORY_LIMIT', '256M' ); // for front end
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // for admin end
View gist:672f3625ed61a8a97791
<?php
define( 'AUTOSAVE_INTERVAL', 120 ); // in seconds
View gist:666c67ec7e2ceceec7d7
<?php
define( 'FS_CHMOD_FILE', 0755 );
define( 'FS_CHMOD_DIR', 0644 );
@duogeekdev
duogeekdev / gist:578e91895befcc361bc7
Created May 9, 2015
Allowing Unfiltered WordPress Uploads for Administrators
View gist:578e91895befcc361bc7
<?php
define( 'ALLOW_UNFILTERED_UPLOADS', true );
@duogeekdev
duogeekdev / gist:fba8617a16fee41716c1
Created May 9, 2015
Enabling the "Trash" Feature for Media Files
View gist:fba8617a16fee41716c1
<?php
define( 'MEDIA_TRASH', true );
You can’t perform that action at this time.