This file contains hidden or 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 | |
add_action( 'save_post', array($self, 'save_custom_fields'), 10, 3 ); | |
function save_custom_fields( $post_id, $post, $update) { | |
if ( $post->post_type != 'pfm_registration' ) { | |
return false; | |
} | |
if ( empty( $_POST['data'] ) ) { | |
return false; |
This file contains hidden or 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 | |
public function pfmEditProfile() | |
{ | |
if (!isset($_POST['pfmEditProfile']) || !wp_verify_nonce($_POST['pfmEditProfile'], 'pfmEditProfile-nonce')) { | |
die("You are not allowed to submit data."); | |
} | |
if ( ! function_exists( 'wp_handle_upload' ) ) { | |
require_once( ABSPATH . 'wp-admin/includes/file.php' ); | |
} |
This file contains hidden or 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 | |
public function hasAnyRole($roles) | |
{ | |
return null !== $this->roles()->whereIn('name', $roles)->first(); | |
} | |
public function hasRole($role) | |
{ | |
return null !== $this->roles()->where('name', $role)->first(); | |
} |
This file contains hidden or 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 | |
public function compiler($in, $out) | |
{ | |
try { | |
$scss = new Compiler(); | |
$scss->setImportPaths(OP_PATH.'assets/scss/'); | |
echo $css = $scss->compile(file_get_contents($in), $in); |
This file contains hidden or 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 | |
public function compiler($in, $out) | |
{ | |
try { | |
$scss = new Compiler(); | |
$scss->setImportPaths(OP_PATH.'assets/scss/'); | |
echo $css = $scss->compile(file_get_contents($in), $in); |
This file contains hidden or 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
$(".img-close").click(function(){ | |
var col12 = $(this).parents(".col-md-12"); | |
var imgTagSrc = $(col12).find("img").attr("src"); | |
var token = $('[name="_token"]').attr("value"); | |
if ($(col12).find("img").attr("id") == 'uploaded-logo') { | |
var type = 'logo' | |
} | |
else { | |
var type = 'ad' |
This file contains hidden or 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 | |
public function filter($merge_data) | |
{ | |
$data = array(); | |
foreach ($merge_data as $key => $value) { | |
$data["{" . $key . "}"] = stripslashes($value); | |
} | |
return $data; | |
} |
This file contains hidden or 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
$('.doc input').fileupload( | |
{ | |
url: WP_Ajax.ajaxurl, | |
sequentialUploads: true, | |
formData: {action: 'upload_file'}, | |
add: function (e, data) { | |
var uploadErrors = []; | |
var acceptFileTypes = /\/(pdf|JPEG|JPG|TIFF|GIF|png|BMP|DOC|DOCX|XLS|XLSX|ODT|ODS)$/i; |
This file contains hidden or 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 | |
echo date("F j, Y g:i a"); |
This file contains hidden or 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
$('.unlink-user').on('click', function(e){ | |
var href = $(this).attr('href'); | |
e.preventDefault(); // <--- prevent form from submitting | |
swal({ | |
title: "Are you sure?", | |
text: "You will not be able to recover this imaginary file!", | |
icon: "warning", | |
buttons: [ | |
'No, cancel it!', |