-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbinary-paperfold.php
More file actions
executable file
·65 lines (52 loc) · 2.04 KB
/
binary-paperfold.php
File metadata and controls
executable file
·65 lines (52 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/*
Plugin Name: Binary Paperfolded Posts
Plugin URI: http://www.plugins.binarygeometry.net/
Version: 1.0.0
Author: Andrew MacKay
Description: Adds paperfold functionality as Wordpress posts snippet. Made possible by the third party code developed at: https://developer.mozilla.org/en-US/demos/detail/paperfold-css..
*/
?>
<?php
function fold_post_shortcode( $atts, $content = null ) {
return '
</div>
</div>
<div class="pf__trigger pf__trigger_collapsed">
<span class="pf__trigger-text pf__trigger-text_collapsed">Expand →</span>
<span class="pf__trigger-text pf__trigger-text_expanded">← Collapse</span>
</div>
<div class="pf__full">
<div class="pf__reducer">
<!-- Long/expandable content -->
'; // end return
}
add_shortcode('fold_post', 'fold_post_shortcode');
class FoldingPost {
public function fold_post(){
include 'paperfold-single-post.php';
}
}
function folding_post() {
$foldingPost = new FoldingPost;
echo $foldingPost->fold_post();
}
function binary_paperfold_scripts() {
wp_register_script( 'modernizr', plugins_url( '/paperfold/js/modernizr.paperfold.js', __FILE__ ),
null, null, false );
wp_enqueue_script( 'modernizr' );
wp_register_script( 'prefixfree', plugins_url( '/paperfold/js/prefixfree.js', __FILE__ ),
null, null, false );
wp_enqueue_script( 'prefixfree' );
wp_register_script( 'paperfold', plugins_url( '/paperfold/js/jquery.paperfold.js', __FILE__ ),
array('jquery'), null, true );
wp_enqueue_script( 'paperfold' );
// run the paperfold code
wp_register_script( 'paperfoldedposts', plugins_url( '/paperfold/js/paper-folded-posts.js', __FILE__ ),
array('jquery'), null, true );
wp_enqueue_script( 'paperfoldedposts' );
wp_register_style('paperfoldcss', plugins_url('paperfold/css/paperfold.css',__FILE__ ));
wp_enqueue_style('paperfoldcss');
}
add_action( 'wp_enqueue_scripts', 'binary_paperfold_scripts' );
?>