Skip to content

CSS and JS always empty in the object returned by fl-builder/v1/123 #2

Description

@TBarregren

The REST API call fl-builder/v1/123 returns an object with the properties id, html, css and js. The two latter are always empty strings. Following implementation of FL_Rest_Content::callback() works as expected:

static function callback( $request ) {

  $post_id = FL_Rest::get_id( $request );

  ob_start();
  \FLBuilder::render_content_by_id( $post_id );
  $output->html = ob_get_clean();

  \FLBuilderModel::set_post_id( $post_id );
  $output->css = FLBuilder::render_css(false);
  $output->js = FLBuilder::render_js(false);
  \FLBuilderModel::reset_post_id();

}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions