Skip to content

Commit

Permalink
Issue #27 - Add Block update command to set block keywords, block cat…
Browse files Browse the repository at this point in the history
…egory and Yoast SEO stuff
  • Loading branch information
bobbingwide committed Feb 25, 2019
1 parent 903d690 commit 91bf4c4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions blocks/oik-blocklist/blocklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const Fragment = wp.element.Fragment;
import { BlockiconStyled } from '../oik-blockicon/blockicons.js';
import { getNameSpace} from './blockprefix.js';


function BlockListStyled( prefix, showBlockTypeName, showTitle, showDescription, showBatch, component, ...props ) {
//var block = getBlockType( blockname ) ;
//var blockicon = BlockiconStyled( blockname, props );
Expand All @@ -33,12 +34,12 @@ function BlockListStyled( prefix, showBlockTypeName, showTitle, showDescription,
var blocklist = <pre>
cd ~/public_html/wp-content/plugins/oik-shortcodes/admin
{block_types.map( (block) => BlockCreateItem( block, component )) }
<br />
</pre>
} else
{
var blocklist =
<dl>

{block_types.map((block) => BlockListItem(block))}
</dl>
}
Expand All @@ -65,7 +66,6 @@ function BlockListItem( block ) {
return( <Fragment>
<dt>
<BlockIcon icon={block.icon.src} />

</dt>
<dd>
{block.title } - {block.name }<br />
Expand All @@ -76,8 +76,12 @@ function BlockListItem( block ) {
}

function BlockCreateItem( block, component ) {
console.log( block );
return( <Fragment><br/>oikwp oik-create-blocks.php {block.name} "{block.title}" {component} url=blocks.wp-a2z.org</Fragment> );
//console.log( block );
var keywords = block.keywords ? block.keywords.join() : null;
return( <Fragment>
<br/>oikwp oik-create-blocks.php {block.name} "{block.title}" {component} url=blocks.wp-a2z.org
<br/>oikwp oik-update-blocks.php {block.name} "{keywords}" {block.category} url=blocks.wp-a2z.org
</Fragment> );
}

export { BlockListStyled };

0 comments on commit 91bf4c4

Please sign in to comment.