GithubHelp home page GithubHelp logo

jigsaw's People

Contributors

arenddeboer avatar awesomephant avatar jarednova avatar pkarl avatar signal-intrusion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jigsaw's Issues

Example on using

Very sorry to put this simple question here, but I didn't know how else to make my question known. If there is a better way/place "next time", please let me know.

I am somewhat new to coding WP so if you could kindly include in your MD, a simple example of including this in something - like a plugin I am building if I wanted to add some of my custom fields to a custom post type?

Where I am stuck is the $callback function. I have a custom date field (that is not the date of the post) that I want to show in a column of the admin UI. I'm not using twig or anything like that. What to I put in the function parameter to show the field column?

Please excuse my low skill level. Your patience is most appreciated.

-John

Images won't resize on the live server

Im trying to add a image preview on a custom post type, being the image itself provided by ACF. Locally on my machine it works as expected, although on the live server the thumbnails won't get resized and always show full-size.

The code im using for this is:

Jigsaw::add_column('banners', 'Preview', function( $post_id ){

    $banner_type = get_field('banner_type');

    if ( $banner_type === "Banner Top" ) {
        $image = get_field('banner_top_image');
    } else {
        $image = get_field('banner_action_image');
    }

    $post = new TimberPost($post_id);

    if ( strlen( $image ) ){
        $post->preview = new TimberImage( $image );
    }

    $data = Timber::get_context();
    $data['post'] = $post;

    Timber::render('admin/banners-image-preview.twig', $data);

}, 1);

And the contents of the template are just:

<img src="{{post.preview.src|resize(100, 80)}}" />

Any thoughts of what might be happening?

Thanks

Suggestion: adding custom taxonomy terms example

It would be nice adding some example on how to add terms from custom taxonomy. There is one:

Jigsaw::add_column($post_type, $column_label, function($post_id){
$term_list = wp_get_post_terms($post_id, $colum_slug, array("fields" => "all"));
if(count($term_list) > 1) {
foreach ($term_list as $term_single) {
echo $term_single->name . " ";
}
} else {
echo $term_list[0]->name;
}
}, 10);

Maybe also adding link term would be greater!

v0.6: Fatal error: Cannot access self:: when no class scope is active

Hey,

Just updated saw and update to v0.6 was available within WordPress.. didn't see a changelog but assumed the best :)

Now any post types that I've added a column to dont load properly - wp debug shows this error:

Fatal error: Cannot access self:: when no class scope is active in /wp-content/plugins/jigsaw/jigsaw.php on line 188

Adding admin CSS in child themes

How can I pass a CSS when using Jigsaw in a child theme?
The function creates the file URL with the get_template_directory_uri() which always retrieves the parent theme location instead of the child theme.

Any way to get around it?

static function add_admin_js_or_css( $file, $function = 'wp_enqueue_style' ) {
        if ( !is_admin() ) {
            return;
        }
        if ( !file_exists( ABSPATH.$file ) ) {
            $file = trailingslashit( get_template_directory_uri() ).$file;
        }
        add_action( 'admin_enqueue_scripts', function() use ( $file, $function ) {
                $function( sanitize_title( $file ), $file );
            } );
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.