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
<?php | |
//here is the correct way to dequeue the select2 js used by acf | |
function my_acf_init() { | |
acf_update_setting('enqueue_select2', false); //this value defaults to true | |
} | |
add_action('acf/init', 'my_acf_init'); |
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
<?php | |
/** | |
* Template Name: Create Post | |
* | |
* @author Mike Hemberger | |
* @link http://thestizmedia.com/front-end-posting-with-acf-pro/ | |
* @uses Advanced Custom Fields Pro | |
*/ | |
/** |
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
<?php | |
class acf_update { | |
/* | |
* __construct | |
* | |
* A good place to add actions / filters | |
* | |
* @type functionac |
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
<head> | |
<?php | |
wp_head(); | |
?> | |
</head> | |
<body> | |
<?php |
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
CREATE OR REPLACE FUNCTION upsert_tableName(arg1 type, arg2 type) RETURNS VOID AS $$ | |
DECLARE | |
BEGIN | |
UPDATE tableName SET col1 = value WHERE colX = arg1 and colY = arg2; | |
IF NOT FOUND THEN | |
INSERT INTO tableName values (value, arg1, arg2); | |
END IF; | |
END; | |
$$ LANGUAGE 'plpgsql'; |