Skip to content

Instantly share code, notes, and snippets.

View Dinamiko's full-sized avatar
💭
just coding stuff

Emili Castells Dinamiko

💭
just coding stuff
View GitHub Profile
[dkpdf-columns]
Your content goes here....
[/dkpdf-columns]
<?php
function custom_dkpdf_pdf_author( $author ) {
$author = 'your-logic-here';
return $author;
}
add_filter( 'dkpdf_pdf_author', 'custom_dkpdf_pdf_author' );
<?php
function custom_dkpdf_pdf_filename( $filename ) {
$current_user = wp_get_current_user();
$filename = $current_user->display_name.' '.get_the_title();
return $filename;
}
add_filter( 'dkpdf_pdf_filename', 'custom_dkpdf_pdf_filename' );
<?php
/**
* Plugin Name: MultilingualPress REST API Extension
* Description: Adds REST endpoints that allow users to get translations for a specific post or term.
* Version: 0.1
*/
class MLP_REST_API_Extension {
public function __construct() {
<i style="font-size:50px;color:orange;" class="fa">&#xf1c1;</i>
[
{
"id": 1,
...
"link": "http://wp-test.dev/hello-world/",
"title": {
"rendered": "Hello world!"
},
...
},
<?php
$content = get_the_content();
$content = str_replace("https", "http", $content);
echo $content;
?>
<?php
/**
* dkpdfg-index.php
* This template is used to display the content in the PDF
*
* Do not edit this template directly,
* copy this template and paste in your theme (or child theme) inside a directory named dkpdfg
*/
?>
<?php
$location = get_field('post_map');
if( !empty($location) ): ?>
<img style="margin-top:25px;" width="1500" height="250" src="http://maps.googleapis.com/maps/api/staticmap?center=<?php echo $location['lat'];?>,<?php echo $location['lng'];?>&zoom=15&size=1500x250&sensor=false&markers=color:red%7Clabel:%7C<?php echo $location['lat'];?>,<?php echo $location['lng'];?>">
<?php endif; ?>