Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggestion: add post_name (aka slug) as a column option #1

Open
hughc opened this issue Sep 18, 2019 · 0 comments
Open

suggestion: add post_name (aka slug) as a column option #1

hughc opened this issue Sep 18, 2019 · 0 comments

Comments

@hughc
Copy link

hughc commented Sep 18, 2019

I'm likely to be an edge case, but I've been rendering blocks on the fly in my templates, via simple function:

function renderBlockById($id) {
  // get reusable gutenberg block:
  $gblock = get_post($id);
  return apply_filters('the_content', $gblock->post_content);
}

In the interests of more readable code, I'd prefer to be passing the 'slug' of a block into this function, but the only place I can get them is from the database itself. Any chance it could be added as an optional column?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant