Skip to content

Instantly share code, notes, and snippets.

@miteshmap
Last active August 29, 2015 14:17
Show Gist options
  • Select an option

  • Save miteshmap/438f6eec30ec44f417e3 to your computer and use it in GitHub Desktop.

Select an option

Save miteshmap/438f6eec30ec44f417e3 to your computer and use it in GitHub Desktop.
ltrim returns wrong block delta for "Edit block" link.
<?php
// Line - 1811 - under "panels_get_pane_links_alter"
// remove the prefix block- to get the name.
$name_of_block = ltrim( $prefixed_name, $subtype_prefix_hyphen);
// correct Method
if (substr($prefixed_name, 0, strlen($subtype_prefix_hyphen)) == $subtype_prefix_hyphen) {
$name_of_block = substr($prefixed_name, strlen($subtype_prefix_hyphen));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment