Skip to content

Instantly share code, notes, and snippets.

@carfis
carfis / acf_save_post_front-end.php
Last active August 29, 2015 14:16
Funktion für ACF um ein Post in Frontend zu erzeugen
<?php
function videoproduzent_pre_save_post( $post_id )
{
// check if this is to be a new post
if( $post_id != 'new' )
{
return $post_id;
}
@carfis
carfis / column.php
Created March 11, 2015 15:09
Column function
/* If displaying the 'schwierigkeit' column. */
case 'schwierigkeit' :
/* Get the schwierigkeit for the post. */
$terms = get_the_terms( $post_id, 'schwierigkeit' );
/* If terms were found. */
if ( !empty( $terms ) ) {
$out = array();
@carfis
carfis / acf_check_postname.php
Created March 13, 2015 18:35
Function change the Post Title and Custom Taxonomy with ACF Front Page Form
// check if this is to be a new post
if( $post_id != 'new' )
{
if (get_the_title($post_id) != $_POST['acf']['field_5434172d1d00f'] ){
$update_post = array(
'ID' => $post_id,
'post_title' => $_POST['acf']['field_5434172d1d00f']
);
// Update the post into the database
@carfis
carfis / jquery-enqueue.php
Created May 1, 2015 10:40
Jquery Wordpress Footer
<?php
//===========================================
// Load JS
//===========================================
function cff_scripts() {
// Load jQuery 2.1.3
wp_deregister_script('jquery');
wp_register_script('jquery', 'https://code.jquery.com/jquery-2.1.3.min.js', false, null);