Git Product home page Git Product logo

Comments (3)

bobbingwide avatar bobbingwide commented on September 25, 2024

Make the block dynamic using Server Side Rendering rather than generating the [github] shortcode

I made the change, or so I thought, but got 404's from the render request.

Problem determination

  1. Check you've added the dynamic server function
$args = [ 'render_callback' => 'oik_bob_bing_wide_dynamic_block_github'];
  1. Check the block name being requested is the same oik-bbw/github
  2. Implement some tracing to see what's happening. Why's it working for oik-bbw/csv
  3. Revisit step 1.
$args = [ 'render_callback' => 'oik_bob_bing_wide_dynamic_block_github'];	
$registered = register_block_type_from_metadata( __DIR__ .'/src/github' );
  1. It would be a good idea to pass $args to the block registration wouldn't it.

Say $args out loud, with a silent s.

from oik-bob-bing-wide.

bobbingwide avatar bobbingwide commented on September 25, 2024

Attempt to support deprecation.

I think I did it this time.

Remove the redundant, hardcoded header

The redundant header is still needed for the deprecated version though.

Make the block dynamic using JavaScript in the editor and Server Side Rendering in the backend.

We can now:

  • remove the redundant shortcode attribute.
  • improve the block's description
  • remove the extra single quotes on the block's description.
  • improve the block's description
  • remove unnecessary CSS

from oik-bob-bing-wide.

bobbingwide avatar bobbingwide commented on September 25, 2024

Delivered in v2.2.1.

from oik-bob-bing-wide.

Related Issues (20)

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.