Skip to content

Instantly share code, notes, and snippets.

@taotiwordpress
Last active August 26, 2020 17:31
Show Gist options
  • Save taotiwordpress/8471839ac2c5638cbe987aad380b431d to your computer and use it in GitHub Desktop.
Save taotiwordpress/8471839ac2c5638cbe987aad380b431d to your computer and use it in GitHub Desktop.
[lorium ipson populate acf text field] function to populate acf fields #php #acf
function field_with_ipsum_fallback( $text ) {
if ( ! empty( $text ) ) {
echo $text;
} else {
echo 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque pellentesque risus vel venenatis faucibus. Nam id pharetra nisl. Nullam viverra eu nisi vel placerat. Donec faucibus blandit dictum';
}
}
function heading_with_ipsum_fallback( $heading ) {
if ( ! empty( $heading ) ) {
echo $heading;
} else {
echo 'Lorem ipsum dolor sit amet';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment