Documentation – screenwriter()

This function will output Screenwriter data as HTML.


screenwriter( $id, $params, $key );


$id (integer) (optional)
The ID of the post from which you want to return data. Use the get_the_id() function or global $post object ID (eg $post->ID) to get the value dynamically.

Default: none

$params (array) (optional)
An array of specified styling and markup parameters to be used when outputted as HTML. This provides a styling framework, however this may prove restrictive during advanced development. It might be more appropriate to output the data manually using the get_screenwriter() function. The styling options are:

  • before – HTML before the item, typically an opening tag. Defaults to “<section>”.
  • after – HTML after the item, typically a closing tag. Defaults to “</section>”.
  • before_title – HYML before the item title, typically an opening tag. Defaults to “<h1>”.
  • after_title – HTML after the item title, typically a closing tag. Defaults to “</h1>”.

Default: array()

$key (string) (optional)
A string value specifying the unique key used to save data to the WordPress post_meta table. A unique key is required to separate data from different Screenwriter instances, preventing possible conflicts.

Default: ‘sc_screenwriter’


Output Screenwriter HTML for current post.

<?php screenwriter(); ?>

Output Screenwriter HTML for the post with the id of 5.

<?php screenwriter(5); ?>


  • A content filter is also in place that will override(unless specified) any saved post_content with Screenwriter data. This will be rendered using the default styling options outlined above in the $params array.